!function(){"use strict";function t(t,e){e?(d[0]=d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0,this.blocks=d):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function i(e,i,a){var n,o=typeof e;if("string"===o){var r,d=[],l=e.length,s=0;for(n=0;n>6,d[s++]=128|63&r):r<55296||r>=57344?(d[s++]=224|r>>12,d[s++]=128|r>>6&63,d[s++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++n)),d[s++]=240|r>>18,d[s++]=128|r>>12&63,d[s++]=128|r>>6&63,d[s++]=128|63&r);e=d}else{if("object"!==o)throw new Error(h);if(null===e)throw new Error(h);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(h)}e.length>64&&(e=new t(i,!0).update(e).array());var c=[],u=[];for(n=0;n<64;++n){var p=e[n]||0;c[n]=92^p,u[n]=54^p}t.call(this,i,a),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=a}var h="input is invalid type",r="object"==typeof window,s=r?window:{};s.JS_SHA256_NO_WINDOW&&(r=!1);var e=!r&&"object"==typeof self,n=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;n?s=global:e&&(s=self);var o=!s.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,a="function"==typeof define&&define.amd,f=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],y=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=["hex","array","digest","arrayBuffer"],d=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var A=function(e,i){return function(a){return new t(i,!0).update(a)[e]()}},w=function(e){var i=A("hex",e);n&&(i=b(i,e)),i.create=function(){return new t(e)},i.update=function(t){return i.create().update(t)};for(var a=0;a>2]|=t[o]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(d[n>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=64?(this.block=d[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},t.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=c[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},t.prototype.hash=function(){var t,e,i,a,n,o,r,d,l,s=this.h0,c=this.h1,u=this.h2,m=this.h3,g=this.h4,_=this.h5,y=this.h6,h=this.h7,f=this.blocks;for(t=16;t<64;++t)e=((n=f[t-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,i=((n=f[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,f[t]=f[t-16]+e+f[t-7]+i<<0;for(l=c&u,t=0;t<64;t+=4)this.first?(this.is224?(o=300032,h=(n=f[0]-1413257819)-150054599<<0,m=n+24177077<<0):(o=704751109,h=(n=f[0]-210244248)-1521486534<<0,m=n+143694565<<0),this.first=!1):(e=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),a=(o=s&c)^s&u^l,h=m+(n=h+(i=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&_^~g&y)+p[t]+f[t])<<0,m=n+(e+a)<<0),e=(m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10),a=(r=m&s)^m&c^o,y=u+(n=y+(i=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&g^~h&_)+p[t+1]+f[t+1])<<0,e=((u=n+(e+a)<<0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),a=(d=u&m)^u&s^r,_=c+(n=_+(i=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&g)+p[t+2]+f[t+2])<<0,e=((c=n+(e+a)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),a=(l=c&u)^c&m^d,g=s+(n=g+(i=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&y^~_&h)+p[t+3]+f[t+3])<<0,s=n+(e+a)<<0;this.h0=this.h0+s<<0,this.h1=this.h1+c<<0,this.h2=this.h2+u<<0,this.h3=this.h3+m<<0,this.h4=this.h4+g<<0,this.h5=this.h5+_<<0,this.h6=this.h6+y<<0,this.h7=this.h7+h<<0},t.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,a=this.h3,n=this.h4,o=this.h5,r=this.h6,d=this.h7,l=u[t>>28&15]+u[t>>24&15]+u[t>>20&15]+u[t>>16&15]+u[t>>12&15]+u[t>>8&15]+u[t>>4&15]+u[15&t]+u[e>>28&15]+u[e>>24&15]+u[e>>20&15]+u[e>>16&15]+u[e>>12&15]+u[e>>8&15]+u[e>>4&15]+u[15&e]+u[i>>28&15]+u[i>>24&15]+u[i>>20&15]+u[i>>16&15]+u[i>>12&15]+u[i>>8&15]+u[i>>4&15]+u[15&i]+u[a>>28&15]+u[a>>24&15]+u[a>>20&15]+u[a>>16&15]+u[a>>12&15]+u[a>>8&15]+u[a>>4&15]+u[15&a]+u[n>>28&15]+u[n>>24&15]+u[n>>20&15]+u[n>>16&15]+u[n>>12&15]+u[n>>8&15]+u[n>>4&15]+u[15&n]+u[o>>28&15]+u[o>>24&15]+u[o>>20&15]+u[o>>16&15]+u[o>>12&15]+u[o>>8&15]+u[o>>4&15]+u[15&o]+u[r>>28&15]+u[r>>24&15]+u[r>>20&15]+u[r>>16&15]+u[r>>12&15]+u[r>>8&15]+u[r>>4&15]+u[15&r];return this.is224||(l+=u[d>>28&15]+u[d>>24&15]+u[d>>20&15]+u[d>>16&15]+u[d>>12&15]+u[d>>8&15]+u[d>>4&15]+u[15&d]),l},t.prototype.toString=t.prototype.hex,t.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,a=this.h3,n=this.h4,o=this.h5,r=this.h6,d=this.h7,l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,r>>24&255,r>>16&255,r>>8&255,255&r];return this.is224||l.push(d>>24&255,d>>16&255,d>>8&255,255&d),l},t.prototype.array=t.prototype.digest,t.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},i.prototype=new t,i.prototype.finalize=function(){if(t.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();t.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),t.prototype.finalize.call(this)}};var B=w();B.sha256=B,B.sha224=w(!0),B.sha256.hmac=_(),B.sha224.hmac=_(!0),o?module.exports=B:(s.sha256=B.sha256,s.sha224=B.sha224,a&&define(function(){return B}))}(),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(t){return 0===this.lastIndexOf(t,0)}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)}),"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),"function"!=typeof Array.prototype.find&&(Array.prototype.find=function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("callback must be a function");for(var a=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var a=arguments[1],n=0;n>>0,a=new Array(i),n=this,o=0,r=-1;if(void 0===e)for(;++r!==i;)if(r in this)if(t(n[r],r,n))a[o++]=n[r];else for(;++r!==i;)r in this&&t.call(e,n[r],r,n)&&(a[o++]=n[r]);return a.length=o,a}),"function"!=typeof Array.prototype.map&&(Array.prototype.map=function(t){var e,i,a;if(null==this)throw new TypeError("this is null or not defined");var n=Object(this),o=n.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(e=arguments[1]),i=new Array(o),a=0;a>>0,n=0;if(arguments.length>=2)e=arguments[1];else{for(;n=a)throw new TypeError("Reduce of empty array with no initial value");e=i[n++]}for(;n/g,">").replaceAll(/").replaceAll(/</g,"<").replaceAll(/'/g,"'").replaceAll(/"/g,'"').replaceAll(/¥/g,"\\").replaceAll(/{/g,"{").replaceAll(/}/g,"}")},String.prototype.format=function(){for(var t=this,e=0;e0&&t.push(e)}),t},Array.prototype.random=function(){return this[Math.floor(Math.random()*this.length)]},Array.prototype.unique=function(){return Array.from(new Set(this))},Array.prototype.except=function(t){var e=this;return Array.isArray(t)&&t.forEach(function(t){var i=e.indexOf(t);-1!=i&&e.splice(i,1)}),e},Array.prototype.only=function(t){var e=[];return Array.isArray(t)&&this.forEach(function(i){-1!=t.indexOf(i)&&e.push(i)}),e},Array.prototype.insert=function(t,e){this.splice(t,0,e)};var equalsLadiPage=function(t,e){return isObjectLadiPage(window.angular)&&isFunctionLadiPage(window.angular.equals)?window.angular.equals(t,e):Object.prototype.toString.call(t)==Object.prototype.toString.call(e)&&JSON.stringify(t)==JSON.stringify(e)},isObjectLadiPage=function(t){return"[object Object]"==Object.prototype.toString.call(t)},isArrayLadiPage=function(t){return"[object Array]"==Object.prototype.toString.call(t)},isFunctionLadiPage=function(t){return"[object Function]"==Object.prototype.toString.call(t)||"[object AsyncFunction]"==Object.prototype.toString.call(t)},isBooleanLadiPage=function(t){return"[object Boolean]"==Object.prototype.toString.call(t)},isStringLadiPage=function(t){return"[object String]"==Object.prototype.toString.call(t)},isEmptyLadiPage=function(t){return!!isNullLadiPage(t)||(isStringLadiPage(t)?0==(t=t.trim().toLowerCase()).length||"undefined"==t||"null"==t:!!isArrayLadiPage(t)&&0==t.length)},isNullLadiPage=function(t){return"[object Null]"==Object.prototype.toString.call(t)||"[object Undefined]"==Object.prototype.toString.call(t)},parseFloatLadiPage=function(t,e){var i=parseFloat(t);try{return parseFloat(LadiPageScript.formatNumber(i,21,null,e||6))}catch(t){return NaN}},decodeURIComponentLadiPage=function(t){try{return decodeURIComponent(t)}catch(e){return t}},formatNumber=function(t,e,i,a){(isEmptyLadiPage(i)||isEmptyLadiPage(a))&&(i="",a=0),isEmptyLadiPage(e)&&(e="");var n=LadiPageScript.formatNumber(t,null,null,a);return n=(n=n.replaceAll(",","LADIPAGE_NUMBER_COMMA").replaceAll(".","LADIPAGE_NUMBER_DOT")).replaceAll("LADIPAGE_NUMBER_COMMA",e).replaceAll("LADIPAGE_NUMBER_DOT",i)},textToNumber=function(t,e,i,a){(isEmptyLadiPage(i)||isEmptyLadiPage(a))&&(a=0);var n=String(t);return isEmptyLadiPage(e)||(n=n.replaceAll(e,"")),isEmptyLadiPage(i)||(n=n.replaceAll(i,".")),n=n.split("."),n=a<=0||1==n.length?n[0]:n[0]+"."+n[1].substring(0,a),parseFloatLadiPage(n)||0},formatNumberComma=function(t,e){return formatNumber(t,",",".",e)},textToNumberComma=function(t,e){return textToNumber(t,",",".",e)},formatNumberDot=function(t,e){return formatNumber(t,".",",",e)},textToNumberDot=function(t,e){return textToNumber(t,".",",",e)},Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,i,a,n,o,r,d,l="",s=0;for(t=Base64._utf8_encode(t);s>2,o=(3&e)<<4|(i=t.charCodeAt(s++))>>4,r=(15&i)<<2|(a=t.charCodeAt(s++))>>6,d=63&a,isNaN(i)?r=d=64:isNaN(a)&&(d=64),l=l+Base64._keyStr.charAt(n)+Base64._keyStr.charAt(o)+Base64._keyStr.charAt(r)+Base64._keyStr.charAt(d);return l},decode:function(t){var e,i,a,n,o,r,d="",l=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,i=(15&n)<<4|(o=Base64._keyStr.indexOf(t.charAt(l++)))>>2,a=(3&o)<<6|(r=Base64._keyStr.indexOf(t.charAt(l++))),d+=String.fromCharCode(e),64!=o&&(d+=String.fromCharCode(i)),64!=r&&(d+=String.fromCharCode(a));return d=Base64._utf8_decode(d)},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i127&&a<2048?(e+=String.fromCharCode(a>>6|192),e+=String.fromCharCode(63&a|128)):(e+=String.fromCharCode(a>>12|224),e+=String.fromCharCode(a>>6&63|128),e+=String.fromCharCode(63&a|128))}return e},_utf8_decode:function(t){for(var e="",i=0,a=0,n=0,o=0;i191&&a<224?(o=t.charCodeAt(i+1),e+=String.fromCharCode((31&a)<<6|63&o),i+=2):(o=t.charCodeAt(i+1),n=t.charCodeAt(i+2),e+=String.fromCharCode((15&a)<<12|(63&o)<<6|63&n),i+=3);return e}},LadiPageScriptV2=LadiPageScriptV2||function(){};LadiPageScriptV2.prototype.init=function(){this.const={DESKTOP:"desktop",MOBILE:"mobile",DEVICE:"device",DOMAIN_GOOGLE_DOCS:"docs.google.com",POWERED_BY_IMAGE:"https://w.ladicdn.com/source/v3/by/ladipage.svg?v=1.0",STATIC_W_DOMAIN:"w.ladicdn.com",STATIC_S_DOMAIN:"s.ladicdn.com",APP_RUNTIME_PREFIX:"_runtime",SCRIPT_LADI_FONT:"ladi-font",SCRIPT_LADI_VARIABLE:"ladi-variable",META_VERSION:{two:2},OPTIMIZE_EXCEPT_EVENT_DATA_KEY_LIST:["custom_style","custom_css","option.form_api_data","option.spinlucky_setting.list_value"],OPTIMIZE_EVENT_DATA_KEY_LIST:["option.is_form_checkout","option.website_list_post_by_category_id","option.website_list_post_by_tag_id","device.option.collection_setting.list_type","scrolling","seller_name","seller_content","seller_like","form_data","value","operator","form_item_value","form_item_type","form_item_type","conditions","dataset_id","sheet_id","image","content","name","verify","time","like","list","text_operator_2","text_operator_1","text_sort_2","text_sort_1","text_description","total","star","star_review","text_unit","star_max","title","link_mapping","color","background_color","border_color","opacity","transform_scale","custom_css","dropbox","padding","animation_duration","str","is_clipboard","link_mapping_custom","change_index_type","change_index_number","collapse_start_is_show","lightbox_type","hidden_ids","show_ids","image_url","video_url","video_type","iframe_url","ontop","action","target","nofollow","position","animation_name","action_type","background-class","background-style","background-image","background-color","background-position","background-repeat","background-size","is_multiple_otp","otp_config_id","is_multiple","is_caption","is_input_label","mapping_form_id","next_button_text","mapping_form_name","input_name","input_required","input_placeholder","show_label","input_tabindex","input_standard","input_checkbox_type","product_setting","ladisale_store_id","form_account_id","options","option.data_formula.is_enable","option.data_formula.text","option.meta_data.version","device.option.carousel_crop.margin_item","device.option.carousel_setting.display_type","option.carousel_setting.autoplay_type","option.only_facebook_widget","option.sync_ladichat_form_account_id","option.sync_ladishare_form_account_id","option.sync_ladiflow_form_account_id","option.sync_ladisales_form_account_id","option.spinlucky_setting.list_value","option.spinlucky_setting.result_popup_id","option.spinlucky_setting.result_message","option.spinlucky_setting.max_turn","option.sheet_id","option.time_show","option.time_delay","option.data_event","option.action_funnel","option.data_tooltip.text","option.data_tooltip.type","option.data_tooltip.position","option.data_tooltip.size","option.conversion_name","option.google_ads_conversion","option.google_ads_label","option.event_custom_script","option.video_value","option.video_type","option.video_control","option.background_video.video_value","option.background_video.video_type","option.show_popup_welcome_page","option.delay_popup_welcome_page","option.show_popup_exit_page","option.popup_welcome_page_scroll_to","option.countdown_item_type","option.countdown_type","option.countdown_minute","option.countdown_daily_start","option.countdown_daily_end","option.countdown_endtime","option.input_type","option.input_default_value","option.input_tabindex","option.form_config_id","option.ladisale_store_id","option.product_tag_id","option.form_send_ladipage","option.data_submit_form_id","option.thankyou_type","option.thankyou_value","option.deeplink_value","option.form_thankyou_funnel","option.form_api_data","option.form_conversion_name","option.form_google_ads_conversion","option.form_purchase_value","option.form_google_ads_label","option.form_event_custom_script","option.form_auto_funnel","option.form_captcha","option.form_auto_complete","option.form_auto_capture","option.input_country","option.is_add_to_cart","option.is_form_coupon","option.is_form_login","option.is_form_otp","option.is_submit_form","option.is_buy_now","option.is_buy_now_ladisales","option.is_add_to_cart_ladisales","option.form_account_id","option.product_type","option.product_id","option.product_variant_id","option.product_mapping_name","option.product_mapping_name_custom","option.product_variant","option.product_variant_type","option.product_variant_title","option.product_variant_price","option.message_no_product","option.cart_layout","option.collection_setting.type","option.data_setting.type","option.data_setting.type_dataset","option.data_setting.value","option.data_setting.sort_name","option.data_setting.sort_by","option.combobox_type","option.survey_setting.is_multiple","option.survey_setting","option.form_setting","option.tabs_setting.current_tab","option.shape_setting.2nd_click","option.shape_setting.source_2nd_click","option.survey_setting.input_name","option.survey_setting.input_required","option.sync_ladisales","option.sync_ladiflow","option.sync_ladishare","option.sync_ladichat","device.option.auto_scroll","device.option.sticky","device.option.sticky_position","device.option.sticky_position_top","device.option.sticky_position_left","device.option.sticky_position_bottom","device.option.sticky_position_right","device.option.readmore_range","device.option.gallery_control.autoplay","device.option.gallery_control.autoplay_time","device.option.video_autoplay","device.option.popup_position","device.option.popup_backdrop","device.option.carousel_setting.autoplay","device.option.carousel_setting.autoplay_time","device.option.carousel_crop.width","device.option.carousel_crop.width_item","device.style.animation-name","device.style.animation-delay","device.option.collection_setting.row","device.option.collection_setting.column","device.option.collection_setting.margin","device.option.image_setting.2nd_click","device.option.image_setting.source_2nd_click","device.option.position","device.option.shape_setting.source_2nd_click","device.option.background-style"],ACTION_TYPE:{menu:"menu",action:"action","1st_click":"1st_click","2nd_click":"2nd_click",hover:"hover",complete:"complete",open_popup:"open_popup",close_popup:"close_popup"},DATA_ACTION_TYPE:{link:"link",page:"page",category:"category",post:"post",section:"section",email:"email",phone:"phone",popup:"popup",dropbox:"dropbox",hidden_show:"hidden_show",collapse:"collapse",set_value:"set_value",tracking:"tracking",custom_script:"custom_script",copy_clipboard:"copy_clipboard",change_index:"change_index",set_style:"set_style",set_value_2nd:"set_value_2nd",lightbox:"lightbox",popup_cart:"popup_cart",popup_checkout:"popup_checkout",next_funnelx:"next_funnelx",set_goal:"set_goal",set_finish:"set_finish"},DATA_ACTION_LIGHTBOX_TYPE:{image:"image",video:"video",iframe:"iframe"},WEBSITE_PATH_DNS:{category:"c",tag:"t",post:"p",page:"",policy:"",news:"",search:""},COUNTDOWN_TYPE:{countdown:"countdown",daily:"daily",endtime:"endtime"},COUNTDOWN_ITEM_TYPE:{day:"day",hour:"hour",minute:"minute",seconds:"seconds"},CAROUSEL_DISPLAY_TYPE:{vertical:"vertical",horizontal:"horizontal"},CAROUSEL_INDICATORS_TYPE_TYPE:{none:"none",circle:"circle",number:"number"},CAROUSEL_AUTOPLAY_TYPE:{type_ab:"type_ab",type_abab:"type_abab",type_abba:"type_abba"},GALLERY_SOURCE_TYPE:{ladisales:"ladisales",default:"default"},VIDEO_TYPE:{youtube:"youtube",direct:"direct"},BACKGROUND_STYLE:{solid:"solid",gradient:"gradient",image:"image",video:"video"},PUBLISH_PLATFORM:{ladipage:"LADIPAGE",ladipagedns:"LADIPAGEDNS",wordpress:"WORDPRESS",haravan:"HARAVAN",sapo:"SAPO",shopify:"SHOPIFY",itop:"ITOPWEBSITE",ftp:"FTP",other:"OTHER"},SECTION_TYPE:{default:"DEFAULT",global:"GLOBAL"},FUNNELX_DISPLAY_SETTING_SHOW_TYPE:{time:"time",leave_page:"leave_page",scroll:"scroll",first_click:"first_click",loaded:"loaded"},FUNNELX_DISPLAY_SETTING_SCROLL_TYPE:{ontop:"ontop",onmiddle:"onmiddle",onbottom:"onbottom"},FUNNELX_DISPLAY_SETTING_HIDE_TYPE:{disable:"disable",hour:"hour",day:"day"},TRACKING_NAME:"ladicid",ACCESS_KEY_NAME:"ladiack",LADIFLOW_DATA_KEY_NAME:"ladifd",REF_NAME:"ref",OTP_TYPE:{send:"OTP_SEND",resend:"OTP_RESEND",sms:"OTP_SMS",voice:"OTP_VOICE",zns:"OTP_ZNS"},STATUS_SEND:{capture:1,otp:1,sendform:2},PUBLISH_STYLE:{desktop_min_width:768,mobile_small_min_width:320},ANIMATED_LIST:["rotate-1","rotate-2","rotate-3","type","scale","loading-bar","slide","clip","zoom","push"],POSITION_TYPE:{default:"default",top:"top",bottom:"bottom",top_left:"top_left",top_center:"top_center",top_right:"top_right",center_left:"center_left",center_right:"center_right",bottom_left:"bottom_left",bottom_center:"bottom_center",bottom_right:"bottom_right"},COLLECTION_TYPE:{carousel:"carousel",readmore:"readmore"},COLLECTION_LIST_TYPE:{horizontal:"horizontal",vertical:"vertical"},INPUT_TYPE:{tel:"tel",password:"password",text:"text",date:"date",select_multiple:"select_multiple",number:"number",email:"email",textarea:"textarea",select:"select",radio:"radio",checkbox:"checkbox",facebook_checkbox_plugin_transactional:"facebook_checkbox_plugin_transactional",facebook_checkbox_plugin_promotional:"facebook_checkbox_plugin_promotional",file:"file",image_choices:"image_choices",product_variant:"product_variant",checkout_product:"checkout_product",checkout_total_price:"checkout_total_price",checkout_bump_offer:"checkout_bump_offer",checkout_coupon_code:"checkout_coupon_code",checkout_fee_shipping:"checkout_fee_shipping",checkout_payment:"checkout_payment"},CONTENT_TYPE:{form_data:"FORM_DATA",form_urlencoded:"X_WWW_FORM_URLENCODED",json:"JSON"},SORT_BY_TYPE:{asc:"asc",desc:"desc"},PRODUCT_VARIANT_TYPE:{combined:"combined",combobox:"combobox",label:"label"},PRODUCT_VARIANT_OPTION_TYPE:{color:1,image:2},PRODUCT_VARIANT_TITLE:{left:"left",top:"top"},FORM_THANKYOU_TYPE:{default:"default",url:"url",popup:"popup",section:"section",url_default:"url_default"},GAME_RESULT_TYPE:{default:"default",popup:"popup",popup_end_of_turn:"popup_end_of_turn"},PERCENT_TRACKING_SCROLL:[0,25,50,75,100],TIME_ONPAGE_TRACKING:[10,30,60,120,180,300,600],FORM_CONFIG_TYPE:{email:"EMAIL",mail_chimp:"MAIL_CHIMP",infusion_soft:"INFUSION_SOFT",infusion_soft_ladi:"INFUSION_SOFT_LADI",active_campaign:"ACTIVE_CAMPAIGN",sendgrid:"SENDGRID",hubspot:"HUBSPOT",smtp:"SMTP",esms:"ESMS",get_response:"GET_RESPONSE",convertkit:"CONVERTKIT",ladiflow:"LADIFLOW",telegram:"TELEGRAM",slack:"SLACK",zalo_zns:"ZALO_ZNS",mautic:"MAUTIC",google_sheet:"GOOGLE_SHEET",google_form:"GOOGLE_FORM",custom_api:"CUSTOM_API",ladisales:"LADISALES",ladishare:"LADISHARE",haravan:"HARAVAN",sapo:"SAPO",shopify:"SHOPIFY",nhanh_vn:"NHANH_VN",google_recaptcha:"GOOGLE_RECAPTCHA",google_recaptcha_checkbox:"GOOGLE_RECAPTCHA_CHECKBOX",google_recaptcha_enterprise:"GOOGLE_RECAPTCHA_ENTERPRISE",google_places_autocomplete:"GOOGLE_PLACES_AUTOCOMPLETE",kiotviet:"KIOTVIET",wordpress:"WORDPRESS",metu:"METU",ladichat:"LADICHAT",shopping:"SHOPPING",blog:"BLOG",conversion_api:"CONVERSION_API",tiktok_conversion_api:"TIKTOK_CONVERSION_API",popupx:"POPUPX"},FORM_UPLOAD_FILE_LENGTH:20,FORM_UPLOAD_FILE_SIZE:25,CART_LAYOUT:{editable:"editable",viewonly:"viewonly"},WIDTH_SECTION_RESIZE:{},RESIZE_ADD_PIXEL:300,RESIZE_ADD_PIXEL_THUMB:50,RESIZE_RANGE:50,TOOLTIP_TYPE:{default:"default",info:"info",success:"success",error:"error",notice:"notice"},TOOLTIP_POSITION:{top_left:"top_left",top_middle:"top_middle",top_right:"top_right",bottom_left:"bottom_left",bottom_middle:"bottom_middle",bottom_right:"bottom_right",left_top:"left_top",left_middle:"left_middle",left_bottom:"left_bottom",right_top:"right_top",right_middle:"right_middle",right_bottom:"right_bottom"},TOOLTIP_SIZE:{small:"small",medium:"medium",big:"big"},OPTION_OTHER_KEY:"LADIPAGE_OTHER",STORY_PAGE:{horizontal:"horizontal",vertical:"vertical",none:"none"},COMBOBOX_TYPE:{delivery_method:"delivery_method"},PRODUCT_TYPE:{event:"Event",service:"Service",physical:"Physical",digital:"Digital",f_b:"F_B",combo:"COMBO",course:"Course"}},this.runtime={backdrop_popup_id:"backdrop-popup",backdrop_dropbox_id:"backdrop-dropbox",lightbox_screen_id:"lightbox-screen",builder_section_popup_id:"SECTION_POPUP",builder_section_background_id:"BODY_BACKGROUND",builder_popup_menu_mobile_id:"POPUP_MENU_MOBILE",ladipage_powered_by_classname:"ladipage_powered_by",current_element_mouse_down_image_compare:null,current_element_mouse_down_image_compare_position_x:0,mouse_down_diff_touch_action:10,current_element_mouse_down_carousel:null,current_element_mouse_down_carousel_position_x:0,current_element_mouse_down_carousel_position_y:0,current_element_mouse_down_carousel_diff:40,current_element_mouse_down_gallery_control:null,current_element_mouse_down_gallery_control_time:0,current_element_mouse_down_gallery_control_time_click:300,current_element_mouse_down_gallery_control_position_x:0,current_element_mouse_down_gallery_view:null,current_element_mouse_down_gallery_view_position_x:0,current_element_mouse_down_gallery_view_position_y:0,current_element_mouse_down_gallery_view_diff:40,country_state_sort:{VN:["201","202","224","220","203"]},location_state_sort:{VN:["HN","SG","HP","CT","DN"]},scroll_show_popup:{},scroll_depth:[],scroll_to_section:{},send_request_response:{},is_mobile_only:!1,interval_countdown:null,interval_gallery:null,timeout_gallery:{},interval_carousel:null,count_click_dom:{},timenext_carousel:{},time_click_dom:{},time_click:300,time_otp:6e4,time_delay_click_button:300,isGenerateHtml:!1,isClient:!1,isDesktop:!0,isBrowserDesktop:!0,isIE:!1,isLoadHtmlGlobal:!1,isYouTubeIframeAPIReady:!1,isLoadYouTubeIframeAPI:!1,isVideoButtonUnmute:!0,device:this.const.DESKTOP,ladipage_id:null,func_get_code_otp:{},list_scroll_func:{},list_loaded_func:[],list_show_popup_func:{},list_youtube_ready_exec:[],list_scrolling_exec:{},list_scrolled_exec:{},list_lightbox_id:{},list_set_value_name_country:["ward","district","state","country"],tmp:{},tabindexForm:0,eventData:{},eventDataGlobal:{},timenow:0,timerefresh:Date.now(),widthScrollBar:0,replaceStr:{},replacePrefixStart:"{{",replacePrefixEnd:"}}",replaceNewPrefixStart:"!::",replaceNewPrefixEnd:"::!"},this.const.WIDTH_SECTION_RESIZE[this.const.DESKTOP]=1440,this.const.WIDTH_SECTION_RESIZE[this.const.MOBILE]=768},"undefined"!=typeof window&&["isObject","isArray","isFunction","isBoolean","isString","isEmpty","isNull"].forEach(function(t){LadiPageScriptV2.prototype[t]=function(e){return window[t+"LadiPage"](e)}}),LadiPageScriptV2.prototype.copy=function(t){if("[object Object]"==Object.prototype.toString.call(t)){var e={};return Object.keys(t).forEach(i=>{e[i]=this.copy(t[i])}),e}if("[object Array]"==Object.prototype.toString.call(t)){var i=[];return t.forEach(t=>{i.push(this.copy(t))}),i}return t};var LadiPageScript=LadiPageScript||new LadiPageScriptV2;LadiPageScript.init();var LadiFormulaData={},LadiFormApi=LadiFormApi||{},LadiPageCommand=LadiPageCommand||[],LadiPageLocation=LadiPageLocation||[],LadiPageShopping=LadiPageShopping||[],LadiPageFormData=LadiPageFormData||[],LadiPageQueueCommandList=LadiPageQueueCommandList||[],LadiPageQueueCommand={push:function(t,e){isFunctionLadiPage(t)&&isFunctionLadiPage(e)&&(t()?e():LadiPageQueueCommandList.push({callback1:t,callback2:e}))}};LadiPageScriptV2.prototype.getCheckoutProductVariantIndex=function(t,e){var i=this,a=-1,n={},o=Array.from(e.querySelectorAll(".ladi-checkout-product-variant > .ladi-frame > .ladi-element .ladi-button-group"));o.forEach(function(t){var e=t.querySelector(".ladi-element.selected");if(!isEmptyLadiPage(e)){var a=i.findAncestor(t,["ladi-frame","ladi-element"]).querySelector(".ladi-frame > .ladi-element > .ladi-paragraph").textContent;n[a]=e.textContent}});var r=Object.keys(n);return r.length==o.length&&isArrayLadiPage(t.variants)&&(a=t.variants.findIndex(function(t){var e=!0;return r.forEach(function(i,a){t["option"+(a+1)]!=n[i]&&(e=!1)}),e})),a},LadiPageScriptV2.prototype.getInfoDetailProductLadiSales=function(t,e,i){var a=this,n=e?a.runtime.store_id:window.$rootScope.getStoreId(),o=e?a.runtime.store_ladiuid:window.$rootScope.store.ladi_uid,r=n+"_"+t;isObjectLadiPage(a.runtime.tmp.product_info_ladisales)||(a.runtime.tmp.product_info_ladisales={});var d=a.runtime.tmp.product_info_ladisales[r];if(isObjectLadiPage(d))!function(t){200==t.code&&isFunctionLadiPage(i)&&i(t.data.product)}(d);else if(!0!==d){var l={product_id:t,ladi_uid:o},s=null;a.runtime.tmp.product_info_ladisales[r]=!0,a.runLimitRequest(20,function(){var o=a.const.API_LADISALE_SHOW_PRODUCT_LDP;(s={"Content-Type":"application/json"})["Store-Id"]=n,l=JSON.stringify(l),a.sendRequest("POST",o,l,!0,s,function(n,o,l){if(l.readyState==XMLHttpRequest.DONE)try{d=JSON.parse(n),a.runtime.tmp.product_info_ladisales[r]=d,a.getInfoDetailProductLadiSales(t,e,i)}catch(t){}})})}else a.runTimeout(function(){a.getInfoDetailProductLadiSales(t,e,i)},100)},LadiPageScriptV2.prototype.frequencyFormDataByKey=function(t){var e={page_view:"pv",submit_form:"sf",view:"v",guest:"g",session:"s",hour:"h",day:"d",week:"w",month:"m"}[t.key]||t.key,i=0,a=window.ladi("LADI_FFD").get_cookie();try{if(a=Base64.decode(a),a=JSON.parse(a),!isObjectLadiPage(a))throw new TypeError("json error")}catch(t){a={}}if(t.getValue)return"session"==t.key?i=parseFloatLadiPage(window.ladi("LADI_SSFFD").get_cookie())||0:"view"==t.key?i=parseFloatLadiPage(this.runtime.tmp.frequency_form_data_view)||0:isObjectLadiPage(a[e])&&parseFloatLadiPage(a[e].e)>=Math.floor(Date.now()/1e3)&&(i=parseFloatLadiPage(a[e].v)||0),i;if(t.addValue>=1)if(i=this.frequencyFormDataByKey({getValue:!0,key:t.key}),i+=t.addValue,"session"==t.key)window.ladi("LADI_SSFFD").set_cookie(i,new Date,null,null,!0);else if("view"==t.key)this.runtime.tmp.frequency_form_data_view=i;else{var n=new Date;n.setTime(n.getTime()+24*t.expires*60*60*1e3),a[e]={e:Math.floor(n.getTime()/1e3),v:i},window.ladi("LADI_FFD").set_cookie(Base64.encode(JSON.stringify(a)),365)}},LadiPageScriptV2.prototype.convertEventDataDevice=function(t,e){var i=this;if(isObjectLadiPage(e)){var a=null,n=null;Object.keys(e).forEach(function(o){o.toLowerCase().startsWith(i.const.DEVICE)&&(a=i.const.DESKTOP+o.substring(i.const.DEVICE.length),n=i.const.MOBILE+o.substring(i.const.DEVICE.length),e[a]=e[o],e[n]=e[o],delete e[o]),t&&o.toLowerCase().startsWith(i.const.DESKTOP)&&(n=i.const.MOBILE+o.substring(i.const.DESKTOP.length),e[n]=e[o]),!t&&o.toLowerCase().startsWith(i.const.MOBILE)&&(a=i.const.DESKTOP+o.substring(i.const.MOBILE.length),e[a]=e[o])})}return e},LadiPageScriptV2.prototype.loadHtmlGlobal=function(t,e){for(var i=this,a=0,n=[],o=document.querySelectorAll(".ladi-section[data-global-id]"),r=0;r0&&i.runtime.hasOwnProperty("cdn_url")&&i.runtime.hasOwnProperty("version")&&o.forEach(function(t){var e=i.runtime.cdn_url+t+".js?v="+i.runtime.version;i.loadScript(e,{defer:!0},null,function(t){i.runAfterLocation()})})};n.forEach(function(t){var e=t.id,n=document.getElementById(e),o=i.const.API_SECTION_GLOBAL_HTML.format(i.runtime.store_id,t.data_global_id);i.sendRequest("GET",o,null,!0,null,function(o,r,d){if(d.readyState==XMLHttpRequest.DONE){var l=document.createElement("div");if(l.innerHTML=o,isEmptyLadiPage(l.querySelector('div.ladi-section-global[data-id="'+t.id+'"] .ladi-section[data-global-id="'+t.data_global_id+'"]')))try{n.parentElement.removeChild(n)}catch(t){}else{var c=i.findAncestor(n,"ladi-section-global");isEmptyLadiPage(c)||(n=c);var u=function(t,e){var i=l.querySelector("style#"+t);isEmptyLadiPage(i)||i.parentElement.removeChild(i),i=l.querySelector("style#"+e),isEmptyLadiPage(i)||i.removeAttribute("media")};i.runtime.is_mobile_only||i.runtime.is_adaptive_design&&i.runtime.adaptive_design_is_mobile?u("style_section_global_desktop","style_section_global_mobile"):i.runtime.is_adaptive_design&&!i.runtime.adaptive_design_is_mobile&&u("style_section_global_mobile","style_section_global_desktop"),l=function(t){return isFunctionLadiPage(window.lazyload_run)&&(t=window.lazyload_run(t,!1,!1)),t.innerHTML}(l);try{var p=document.createRange().createContextualFragment(l);n.parentElement.replaceChild(p,n)}catch(t){n.outerHTML=l}}!function(t){a++;var e=document.querySelector('.ladi-section-global[data-id="'+t+'"] > script');if(isEmptyLadiPage(e))s();else{var n=null;try{n=JSON.parse(e.innerHTML),Object.keys(n).forEach(function(t){n[t]=i.deOptimizeEventData(i.copy(n[t]),i.const.OPTIMIZE_EVENT_DATA_KEY_LIST,"OPTIMIZE_EVENT_DATA_KEY_LIST"),n[t]=i.decodeValue(n[t])})}catch(t){}e.parentElement.removeChild(e),s(n)}}(e)}})}),s()},LadiPageScriptV2.prototype.checkHover=function(){var t="ladi_check_hover",e=document.getElementById(t);return isEmptyLadiPage(e)&&((e=document.createElement("div")).id=t,e.className="ladi-check-hover",e.style.setProperty("display","none","important"),document.body.appendChild(e)),0==getComputedStyle(e).opacity},LadiPageScriptV2.prototype.setLadiVariable=function(){for(var t=document.querySelectorAll("script."+this.const.SCRIPT_LADI_VARIABLE),e=0;e0&&(a+=n),e[t]=a,o++,"id"==a&&r(t)};return t.forEach(r),e},LadiPageScriptV2.prototype.optimizeEventData=function(t,e,i){var a=this,n=a.runtime.tmp["DATA_O_"+i];if(isArrayLadiPage(e)&&isNullLadiPage(n)){var o=[];"OPTIMIZE_EVENT_DATA_KEY_LIST"==i?(e.forEach(function(t){o.push(t),t.startsWith(a.const.DEVICE+".")&&(o.push(a.const.DESKTOP+t.substring(a.const.DEVICE.length)),o.push(a.const.MOBILE+t.substring(a.const.DEVICE.length)))}),o.push("type")):o=e,n=a.getOptimizeSourceKey(o),a.runtime.tmp["DATA_O_"+i]=n}isObjectLadiPage(t)&&Object.keys(t).forEach(function(e){-1==a.const.OPTIMIZE_EXCEPT_EVENT_DATA_KEY_LIST.indexOf(e)?isNullLadiPage(n[e])?t[e]=a.optimizeEventData(t[e],null,i):(t[n[e]]=a.optimizeEventData(t[e],null,i),delete t[e]):isNullLadiPage(n[e])||(t[n[e]]=t[e],delete t[e])});return isArrayLadiPage(t)&&t.forEach(function(e,n){t[n]=a.optimizeEventData(e,null,i)}),t},LadiPageScriptV2.prototype.deOptimizeEventData=function(t,e,i){var a=this,n=a.runtime.tmp["DATA_D_"+i];if(isArrayLadiPage(e)&&isNullLadiPage(n)){n={},a.optimizeEventData(null,e,i);var o=a.runtime.tmp["DATA_O_"+i];Object.keys(o).forEach(function(t){n[o[t]]=t}),a.runtime.tmp["DATA_D_"+i]=n}return isObjectLadiPage(t)&&Object.keys(t).forEach(function(e){-1==a.const.OPTIMIZE_EXCEPT_EVENT_DATA_KEY_LIST.indexOf(e)?isNullLadiPage(n[e])?t[e]=a.deOptimizeEventData(t[e],null,i):(t[n[e]]=a.deOptimizeEventData(t[e],null,i),delete t[e]):isNullLadiPage(n[e])||(t[n[e]]=t[e],delete t[e])}),isArrayLadiPage(t)&&t.forEach(function(e,n){t[n]=a.deOptimizeEventData(e,null,i)}),t},LadiPageScriptV2.prototype.postMessageWindow=function(t,e,i){t.postMessage(JSON.stringify(e),i)},LadiPageScriptV2.prototype.updateHeightElement=function(t,e,i,a,n,o){var r=this;if(a!=n){var d="style_update_height_element",l=!0;if("fixed"==getComputedStyle(e).position&&(l=!1),t){r.runtime.tmp.dimension_element_new={};var s="#"+r.runtime.builder_section_popup_id+" > .ladi-container > .ladi-element { max-height: none !important;}";r.createStyleElement(d,s)}for(var c,u,p=function(t,i){return t.id==e.id&&"height"==i?n:isEmptyLadiPage(r.runtime.tmp.dimension_element_new[t.id+i])?parseFloatLadiPage(getComputedStyle(t)[i])||0:r.runtime.tmp.dimension_element_new[t.id+i]},m=function(t,e,i){var a=p(t,e)+i;if(o){var n="transition-parent-collapse-"+e;t.classList.add(n);var d=1e3*parseFloatLadiPage(getComputedStyle(t).transitionDuration);r.runTimeout(function(){t.classList.remove(n)},d)}t.style.setProperty(e,a+"px"),r.runtime.tmp.dimension_element_new[t.id+e]=a},g=function(t){for(var e=[],i=0;i=y&&m(v,"top",_))}if(!isEmptyLadiPage(i)&&i.id!=r.runtime.builder_section_popup_id){var E=p(i,"height"),P=function(){for(var t=0,i=g(e),a=0;at&&(t=o)}}return t}();if((i.classList.contains("ladi-section")||i.getElementsByClassName("ladi-popup").length>0)&&(P=E+_),m(i,"height",P-E),l){var L=(c=i,u=r.findAncestor(c.parentElement,"ladi-element"),isEmptyLadiPage(u)&&(u=r.findAncestor(c.parentElement,"ladi-section")),u);this.updateHeightElement(!1,i,L,E,P,o)}}if(t){if(this.runtime.tmp.is_loaded_func_done){var b=document.getElementById(d);isEmptyLadiPage(b)||b.parentElement.removeChild(b)}delete r.runtime.tmp.dimension_element_new,r.runtime.tmp.is_window_resize||r.fireEvent(window,"resize",{set_viewport:!1})}}},LadiPageScriptV2.prototype.showParentVisibility=function(t,e){var i=this.findAncestor(t,"ladi-popup");if(!isEmptyLadiPage(i)&&(i=this.findAncestor(i,"ladi-element"),!isEmptyLadiPage(i)))return"none"==getComputedStyle(i).display&&i.classList.add("hide-visibility"),isFunctionLadiPage(e)&&e(),void i.classList.remove("hide-visibility");isFunctionLadiPage(e)&&e()},LadiPageScriptV2.prototype.pauseAllVideo=function(t){var e=document.getElementById(this.runtime.lightbox_screen_id).getElementsByClassName("lightbox-close")[0];if(!isEmptyLadiPage(e))return e.click(),this.pauseAllVideo(t);delete this.runtime.tmp.gallery_playing_video;for(var i=(t=t||document).querySelectorAll(".iframe-video-preload:not(.no-pause)"),a=0;a",n.className="button-unmute ladi-hidden",n.addEventListener("click",function(i){if(i.stopPropagation(),t=document.getElementById(t.id),e==c.const.VIDEO_TYPE.youtube){var a=!1;if(c.runtime.isYouTubeIframeAPIReady){var o=window.YT.get(t.id);!isEmptyLadiPage(o)&&isFunctionLadiPage(o.unMute)&&(o.unMute(),a=!0)}a||c.postMessageWindow(t.contentWindow,{event:"command",func:"unMute",args:[]},"*")}e==c.const.VIDEO_TYPE.direct&&(t.muted=!1),n.parentElement.removeChild(n),t.setAttribute("data-remove-button-unmute",!0)}),t.parentElement.appendChild(n)),i&&n.classList.remove("ladi-hidden");var o=c.findAncestor(t,"lightbox-screen");isEmptyLadiPage(o)||(n.style.setProperty("width",getComputedStyle(t).width),n.style.setProperty("height",getComputedStyle(t).height))}},m=document.getElementById(t);if(!isEmptyLadiPage(m)){var g=c.findAncestor(m,"ladi-video");isEmptyLadiPage(g)||(g=c.findAncestor(g,"ladi-element")),!a||o||isEmptyLadiPage(g)||(g.classList.add("pointer-events-none"),m.classList.add("no-pause")),r&&m.classList.add("ladi-hidden");var _="";if(!isEmptyLadiPage(g)){var y=g.getElementsByClassName("ladi-video-background")[0];if(!isEmptyLadiPage(y)){var h=getComputedStyle(y).backgroundImage;h.toLowerCase().startsWith('url("')&&h.toLowerCase().endsWith('")')&&(h=(h=h.substr('url("'.length)).substr(0,h.length-'")'.length),isEmptyLadiPage(h)||(_=h))}}if(e==c.const.VIDEO_TYPE.youtube){var f=c.getVideoId(e,i),v=function(){try{if(c.runtime.isLoadYouTubeIframeAPI&&c.runtime.isYouTubeIframeAPIReady||!isObjectLadiPage(window.YT)||!isFunctionLadiPage(window.YT.Player)||(c.runtime.isLoadYouTubeIframeAPI=!0,c.runtime.isYouTubeIframeAPIReady=!0),c.runtime.isLoadYouTubeIframeAPI||(c.runtime.isLoadYouTubeIframeAPI=!0,window.onYouTubeIframeAPIReady=function(){c.runtime.isYouTubeIframeAPIReady=!0;for(;c.runtime.list_youtube_ready_exec.length>0;)c.runtime.list_youtube_ready_exec.shift()()},c.loadScript("https://www.youtube.com/iframe_api")),!c.runtime.isYouTubeIframeAPIReady)return void c.runtime.list_youtube_ready_exec.push(v);m.outerHTML=m.outerHTML.replaceAll("",""),m=document.getElementById(t),n&&m.classList.add("opacity-0");var e=function(){n&&(m=document.getElementById(t)).classList.remove("opacity-0")},i=e,g=function(e){m=document.getElementById(t);var i=window.YT.get(t);isEmptyLadiPage(i)||isEmptyLadiPage(m)?c.runTimeout(g,100):(c.runResizeAll(),a||u?i.mute():i.unMute(),r||d||i.playVideo(),isFunctionLadiPage(s)&&s(),p(m))};new window.YT.Player(t,{videoId:f,playerVars:{rel:0,modestbranding:0,playsinline:n||a||l||u?1:0,controls:!n&&o?1:0},events:{onReady:g,onStateChange:function(i){if(i.data==window.YT.PlayerState.PLAYING){if(m=document.getElementById(t),n){var a=function(){window.YT.get(t).getCurrentTime()>=.1?e():c.runTimeout(a,100)};a()}p(m,!0);var o=document.getElementById(t+"_button_unmute");isEmptyLadiPage(o)||window.YT.get(t).mute()}i.data==window.YT.PlayerState.ENDED&&window.YT.get(t).playVideo()},onError:i}})}catch(t){}};v()}if(e==c.const.VIDEO_TYPE.direct){isEmptyLadiPage(_)||m.setAttribute("poster",_),m.setAttribute("preload","auto"),m.setAttribute("controlslist","nodownload"),m.setAttribute("loop",""),r||d||m.setAttribute("autoplay",""),(n||a||l||u)&&(m.setAttribute("playsinline",""),m.setAttribute("webkit-playsinline","")),!n&&o&&m.setAttribute("controls",""),a||u?m.setAttribute("muted",""):m.removeAttribute("muted"),n&&m.classList.add("opacity-0");var E=function(){n&&(m=document.getElementById(t)).classList.remove("opacity-0")};m.removeAttribute("src"),m.setAttribute("data-src",i),m.outerHTML=m.outerHTML.replaceAll("data-src=","src="),m=document.getElementById(t),isFunctionLadiPage(s)&&s(m),m.addEventListener("loadedmetadata",function(t){p(m)}),m.addEventListener("error",E),m.addEventListener("playing",function(t){if(n){var e=function(){m.currentTime>=.1?E():c.runTimeout(e,100)};e()}p(m,!0);var i=document.getElementById(m.id+"_button_unmute");isEmptyLadiPage(i)||(m.muted=!0)})}}},LadiPageScriptV2.prototype.playVideo=function(t,e,i,a,n,o){var r=document.getElementById(t);if(!isEmptyLadiPage(r)){var d=document.getElementById(t+"_player");if(o||n||this.pauseAllVideo(),isEmptyLadiPage(d)){var l=r.getElementsByClassName("ladi-video")[0],s=t+"_player";e==this.const.VIDEO_TYPE.youtube&&(!n&&r.hasAttribute("data-video-played")||(l.innerHTML=l.innerHTML+'',this.runEventPlayVideo(s,e,i,n,!1,a,o))),e==this.const.VIDEO_TYPE.direct&&(l.innerHTML=l.innerHTML+'',this.runEventPlayVideo(s,e,i,n,!1,a,o))}else this.runEventReplayVideo(d.id,e,!0)}},LadiPageScriptV2.prototype.checkResizeImage=function(t){var e=[".jpg",".jpeg",".png"],i=function(t){for(var i=!1,a=0;al+1&&(d[l+1]=d[l+1].toLowerCase()),l=d.indexOf(this.const.STATIC_W_DOMAIN.toLowerCase()),this.checkResizeImage(t)&&-1!=l&&(d.length==l+3||d.length==l+6&&"ls"==d[3]&&"product"==d[5]||d.length==l+4&&"luid"==d[3]&&"avatar"==d[4]||d.length==l+4&&"rbg"==d[4])){var s=d[l+1].toLowerCase(),c=!0;if(s.startsWith("s")){var u=s.split("x");2==u.length&&parseFloatLadiPage(u[1])==u[1]&&(c=!1)}if(c){if(r||n){if(e=parseInt(e)||0,i=parseInt(i)||0,a){var p=this.const.RESIZE_RANGE+(o?this.const.RESIZE_ADD_PIXEL_THUMB:this.const.RESIZE_ADD_PIXEL);(e<=0||i<=0)&&(p*=2),e=e-e%this.const.RESIZE_RANGE+p,i=i-i%this.const.RESIZE_RANGE+p}}else e=this.const.WIDTH_SECTION_RESIZE[LadiPage.data.device_screen],i=this.const.WIDTH_SECTION_RESIZE[LadiPage.data.device_screen];d.insert(l+1,"s"+e+"x"+i)}}return t=d.join("/")},LadiPageScriptV2.prototype.historyReplaceState=function(t){try{window.history.replaceState(null,null,t)}catch(t){}},LadiPageScriptV2.prototype.resetViewport=function(){},LadiPageScriptV2.prototype.runStoryPage=function(){var t=this,e=t.runtime.story_page;if(isObjectLadiPage(e)){var i=document.getElementsByClassName("ladi-wraper")[0];if(!isEmptyLadiPage(i)){var a=document.getElementsByClassName("ladi-story-page-progress-bar")[0];isEmptyLadiPage(a)||a.parentElement.removeChild(a);var n=document.querySelectorAll('.ladi-section:not([id="'+this.runtime.builder_section_popup_id+'"]):not([id="'+this.runtime.builder_section_background_id+'"])');if(0!=n.length){(a=document.createElement("div")).className="ladi-story-page-progress-bar";for(var o=null,r=(n[0],function(e,i){e.addEventListener("click",function(e){e.stopPropagation(),t.removeTimeout(t.runtime.tmp.story_page_next_timeout_id),window.ladi(i.id,i).scroll()})}),d=0;d100?100:n,a.style.setProperty("width",n+"%"),n>=100&&(t.runtime.tmp.story_page_next_timeout_id=t.runTimeout(function(){isEmptyLadiPage(a.parentElement)||s(a.parentElement.nextElementSibling,!0)},i),i*=2)}t.runtime.tmp.story_page_timeout_id=t.runTimeout(c,i)}};s(o,!1),t.runtime.tmp.story_page_timeout_id=t.runTimeout(c,300),document.addEventListener("mousedown",function(e){t.runtime.tmp.story_page_mouse_down=!0}),document.addEventListener("touchstart",function(e){t.runtime.tmp.story_page_mouse_down=!0},t.runtime.scrollEventPassive),document.addEventListener("mouseup",function(e){t.runtime.tmp.story_page_mouse_down=!1}),document.addEventListener("touchend",function(e){t.runtime.tmp.story_page_mouse_down=!1}),i.addEventListener("scroll",function(a){isEmptyLadiPage(t.runtime.tmp.current_default_popup_id)&&(t.runtime.tmp.story_page_scroll=!0,t.removeTimeout(t.runtime.tmp.story_page_scroll_timeout_id),t.removeTimeout(t.runtime.tmp.story_page_timeout_id),t.runtime.tmp.story_page_scroll_timeout_id=t.runTimeout(function(){var a=0,n=e.type==t.const.STORY_PAGE.horizontal?i.scrollLeft/i.clientWidth:i.scrollTop/i.clientHeight;if((n=Math.floor(n+1.5))!=t.runtime.tmp.story_page_current_page){t.runtime.tmp.story_page_current_page=n;var o=document.querySelector(".ladi-story-page-progress-bar-item:nth-child("+n+")");t.removeTimeout(t.runtime.tmp.story_page_next_timeout_id),s(o,!1),a=100}t.runtime.tmp.story_page_scroll=!1,delete t.runtime.tmp.story_page_scroll_timeout_id,t.runtime.tmp.story_page_timeout_id=t.runTimeout(c,a)},300))},t.runtime.scrollEventPassive)}}}},LadiPageScriptV2.prototype.runThankyouPage=function(){var t=this,e=t.runtime.thankyou_page;if(isObjectLadiPage(e)){var i={is_custom:!0};i.conversion_name=e.event_value,i.google_ads_conversion=e.event_id,i.google_ads_label=e.event_label,i.purchase_value=e.purchase_value,i.event_category="LadiPageThankYouPage";var a=null;["phone","email"].forEach(function(e){var i=t.getDataReplaceStr(e);isEmptyLadiPage(i)||(isObjectLadiPage(a)||(a={}),a[e]=i)}),t.runEventTracking(null,i,a),delete t.runtime.thankyou_page}},LadiPageScriptV2.prototype.runResizeSectionBackground=function(){var t=this;t instanceof LadiPageScriptV2||(t=LadiPageScript);try{for(var e=document.querySelectorAll(".ladi-section .ladi-section-background iframe.ladi-section-background-video"),i=0;i .ladi-element"),a=0;a0;)i[0].classList.remove("ladi-lazyload")},LadiPageScriptV2.prototype.reloadLazyload=function(t){var e=this;if(e instanceof LadiPageScriptV2||(e=LadiPageScript),e.runtime.tmp.is_loaded_func_done){var i=[];if(t&&isObjectLadiPage(e.runtime.story_page)){var a=document.getElementsByClassName("ladi-section")[0];if(!isEmptyLadiPage(a))for(i=a.getElementsByClassName("ladi-lazyload");i.length>0;)i[0].classList.remove("ladi-lazyload")}else{i=document.getElementsByClassName("ladi-lazyload");for(var n=[],o=0;or&&r+i[o].offsetHeight>window.scrollY&&n.push(i[o])}n.forEach(function(t){t.classList.remove("ladi-lazyload")});for(var d=document.querySelectorAll(".ladi-gallery .ladi-gallery-view-item.selected:not(.ladi-lazyload)"),l=0;l0;)s[0].classList.remove("ladi-lazyload")}}}},LadiPageScriptV2.prototype.documentLoaded=function(){var t=this;if(t instanceof LadiPageScriptV2||(t=LadiPageScript),LadiPageApp.review_callback_loaded(!0,t.documentLoaded)){t.const.LANG=JSON.stringify(t.const.LANG),t.const.LANG=t.convertReplacePrefixStr(t.const.LANG),t.const.LANG=JSON.parse(t.const.LANG);try{t.runtime.payment_setting=JSON.stringify(t.runtime.payment_setting),t.runtime.payment_setting=t.convertReplacePrefixStr(t.runtime.payment_setting),t.runtime.payment_setting=JSON.parse(t.runtime.payment_setting)}catch(e){t.runtime.payment_setting={}}t.runtime.tmp.lang_loaded=!0;var e=t.getURLSearchParams(null,null,!0),i=e.ladishow,a=e.ladihide,n=e.laditop,o=window.location.hash;isEmptyLadiPage(i)?i=[]:isArrayLadiPage(i)||(i=i.split(",").removeSpace()),isEmptyLadiPage(a)?a=[]:isArrayLadiPage(a)||(a=a.split(",").removeSpace()),isEmptyLadiPage(n)?n=[]:isArrayLadiPage(n)||(n=n.split(",").removeSpace().reverse());try{var r=window.ladi("LADI_CAMP_END_DATE").get_cookie(),d=window.ladi("LADI_CAMP_CONFIG").get_cookie();if(!isEmptyLadiPage(r)&&!isEmptyLadiPage(d)){d=JSON.parse(Base64.decode(d));var l=((r=parseInt(r)||0)-Date.now())/24/60/60/1e3;if(l>0&&isArrayLadiPage(d.dynamic_content.cookie)){var s=[];d.dynamic_content.cookie.forEach(function(t){var e=t.split("=");2!=(e=e.removeSpace()).length||isEmptyLadiPage(e[0])||isEmptyLadiPage(e[1])||s.push({name:e[0],value:e[1]})}),s.forEach(function(t){window.ladi(t.name).set_cookie(t.value,l)})}a=d.dynamic_content.hide||[],i=d.dynamic_content.show||[],n=d.dynamic_content.top||[],isArrayLadiPage(d.dynamic_content.scroll)&&d.dynamic_content.scroll.length>0&&(o="#"+d.dynamic_content.scroll.pop())}}catch(t){}var c=null,u=[];if(i.forEach(function(t){var e=document.getElementById(t);isEmptyLadiPage(e)||e.getElementsByClassName("ladi-popup").length>0&&u.push(t)}),u.length>0&&!isEmptyLadiPage(o))try{c=document.querySelector(o),isEmptyLadiPage(c)||isEmptyLadiPage(c.id)||!c.classList.contains("ladi-section")||(o=null,i=i.except(u),t.runTimeout(function(){window.ladi(c.id).scroll(!1,!0),u.forEach(function(t){window.ladi(t).show()})},300))}catch(t){}if(a.forEach(function(t){window.ladi(t).hide()}),i.forEach(function(t){window.ladi(t).show()}),n.forEach(function(t){window.ladi(t).top()}),!isEmptyLadiPage(o))try{c=document.querySelector(o),isEmptyLadiPage(c)||isEmptyLadiPage(c.id)||t.runTimeout(function(){window.ladi(c.id).scroll()},300)}catch(t){}if(t.resetViewport(),t.runEventScroll(),!isEmptyLadiPage(t.runtime.tracking_global_url)){var p=!1,m=window;isObjectLadiPage(t.runtime.story_page)&&(m=document.getElementsByClassName("ladi-wraper")[0]);var g=function(){p||(p=!0,t.loadScript(t.runtime.tracking_global_url+"?v="+Date.now(),{defer:!0},null,function(){t.runtime.tmp.tracking_global_loaded=!0}),m.removeEventListener("scroll",g),document.removeEventListener("mousemove",g),document.removeEventListener("touchstart",g))};m.addEventListener("scroll",g,t.runtime.scrollEventPassive),document.addEventListener("mousemove",g),document.addEventListener("touchstart",g,t.runtime.scrollEventPassive),t.runTimeout(g,t.runtime.tracking_global_delay)}for(;t.runtime.list_loaded_func.length>0;){t.runtime.list_loaded_func.shift()()}t.runtime.tmp.is_loaded_func_done=!0;var _=document.getElementById("style_update_height_element");isEmptyLadiPage(_)||_.parentElement.removeChild(_);var y=document.getElementById("style_animation");isEmptyLadiPage(y)||y.parentElement.removeChild(y),t.reloadLazyload(!1)}},LadiPageScriptV2.prototype.runConversionApi=function(t,e,i,a){var n=this;a=isObjectLadiPage(a)?a:{},isFunctionLadiPage(n.runtime.tmp.runTrackingAnalytics)?LadiPageQueueCommand.push(function(){return"facebook"==t?isFunctionLadiPage(window.fbq):"tiktok"==t?!isNullLadiPage(window.ttq):void 0},function(){if(!isEmptyLadiPage(t)&&!isEmptyLadiPage(e)&&isObjectLadiPage(window.ladi_conversion_api)&&isObjectLadiPage(window.ladi_conversion_api[t])&&(window.ladi_conversion_api[t][e]=i),isObjectLadiPage(window.ladi_conversion_api)&&isObjectLadiPage(window.ladi_conversion_api[t])&&isArrayLadiPage(window.ladi_conversion_api[t].pixels)&&isArrayLadiPage(window.ladi_conversion_api[t].events)){window.ladi_conversion_api[t].pixels=window.ladi_conversion_api[t].pixels.unique();var o=Date.now()+3e3,r=function(t,e){var i=[],d=!0;t.forEach(function(t){var e=window.ladi(t).get_cookie();isEmptyLadiPage(e)&&(d=!1),i.push(e)}),!a.is_return_string&&!d&&Date.now()0?window.innerWidth:window.screen.width:window.outerWidth>0?window.outerWidth:window.screen.width},LadiPageScriptV2.prototype.getHeightDevice=function(t){return window.outerHeight>0&&!this.runtime.isDesktop&&(t&&window.outerHeight>window.innerHeight||!t&&window.innerHeight>window.outerHeight)?window.outerHeight:window.innerHeight},LadiPageScriptV2.prototype.startAutoScroll=function(t,e,i,a){if(this.runtime.isDesktop?i:a){var n=document.getElementById(t);if(!isEmptyLadiPage(n)&&!n.classList.contains("ladi-auto-scroll")){var o=0;if("section"!=e){if((parseFloatLadiPage(getComputedStyle(n).width)||0)<=this.getWidthDevice())return;o=(o=parseFloatLadiPage(getComputedStyle(n).left)||0)>0?0:-1*o}else{for(var r=n.querySelectorAll(".ladi-container > .ladi-element"),d=0;d0?0:-1*o,n.querySelector(".ladi-container").style.setProperty("margin-left",o+"px")}n.classList.add("ladi-auto-scroll"),n.scrollLeft=o}}},LadiPageScriptV2.prototype.getLinkUTMRedirect=function(t,e){var i=this.createTmpElement("a","",{href:t}),a=this.getURLSearchParams(e,null,!1),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];if(n.push(this.const.LADIFLOW_DATA_KEY_NAME),n.push(this.const.REF_NAME),!isEmptyLadiPage(i.href)&&!isEmptyLadiPage(i.host)){var o=this.getURLSearchParams(i.search,null,!1),r=[];isArrayLadiPage(window.LadiPageURLSearchParamsCustom)&&(r=window.LadiPageURLSearchParamsCustom),isStringLadiPage(window.LadiPageURLSearchParamsCustom)&&(r=[window.LadiPageURLSearchParamsCustom]),(n=(n=n.concat(r)).unique()).forEach(function(t){isEmptyLadiPage(o[t])&&!isEmptyLadiPage(a[t])&&(i.search=i.search+(isEmptyLadiPage(i.search)?"?":"&")+t+"="+encodeURIComponent(a[t]),o[t]=a[t])})}return i.href},LadiPageScriptV2.prototype.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},LadiPageScriptV2.prototype.randomString=function(t){for(var e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",a=i.length,n=0;n0)return setTimeout(t,e);t()}},LadiPageScriptV2.prototype.removeTimeout=function(t){return clearTimeout(t)},LadiPageScriptV2.prototype.removeInterval=function(t){return clearInterval(t)},LadiPageScriptV2.prototype.runInterval=function(t,e){if(isFunctionLadiPage(t))return setInterval(t,e)},LadiPageScriptV2.prototype.getURLSearchParams=function(t,e,i){var a={},n=isNullLadiPage(t);if(t=n?window.location.search:t,!isEmptyLadiPage(t))for(var o=t.substr(1).split("&"),r=0;r0&&(r.runtime.tmp.send_request_configs[r.const.API_FORM_DATA]={timeout:r.const.API_FORM_DATA_TIMEOUT,list:e}),void l()}d(t)};l()},LadiPageScriptV2.prototype.sendRequestWithOption=function(t,e,i,a,n,o,r){if(!this.runtime.isGenerateHtml){if(this.runtime.has_popupx&&this.runtime.request_through_parent){var d=this.randomId();return this.runtime.tmp["request_callback_id_"+d]=r,void this.runtime.tmp.runActionPopupX({request_data:{method:t,url:e,data:i,async:a,headers:n,options:o,callback_id:d},action:{type:"send_request_with_option"}})}var l=new XMLHttpRequest;if(isFunctionLadiPage(this.runtime.send_request_response[e])){var s=this.runtime.send_request_response[e](e,i,r);if(!0===s)return;i=s}isFunctionLadiPage(r)&&(l.onreadystatechange=function(){var t=null;try{t=this.responseText}catch(t){}r(t,this.status,this,e)}),l.open(t,e,a);isObjectLadiPage(n)&&Object.keys(n).forEach(function(t){l.setRequestHeader(t,n[t])}),isObjectLadiPage(o)&&Object.keys(o).forEach(function(t){l[t]=o[t]}),l.send(i)}},LadiPageScriptV2.prototype.setCookieDomains=function(t,e,i){window.ladi(t).set_cookie(e,i,"/",window.location.host),isArrayLadiPage(this.runtime.DOMAIN_SET_COOKIE)&&this.runtime.DOMAIN_SET_COOKIE.forEach(function(a){a!=window.location.host&&window.ladi(t).set_cookie(e,i,"/",a)})},LadiPageScriptV2.prototype.removeCookieDomains=function(t){window.ladi(t).set_cookie(null,-365,"/",window.location.host),isArrayLadiPage(this.runtime.DOMAIN_SET_COOKIE)&&this.runtime.DOMAIN_SET_COOKIE.forEach(function(e){e!=window.location.host&&window.ladi(t).set_cookie(null,-365,"/",e)})},LadiPageScriptV2.prototype.deleteCookie=function(t){return window.ladi(t).delete_cookie()},LadiPageScriptV2.prototype.setCookie=function(t,e,i,a,n,o){return window.ladi(e).set_cookie(i,a,o,t,n)},LadiPageScriptV2.prototype.getCookie=function(t){return window.ladi(t).get_cookie()},LadiPageScriptV2.prototype.convertDataDate=function(t,e){function i(t){return(t>=10?"":"0")+t}return e.forEach(function(e){try{var a=new Date(t[e]);a.toISOString()==t[e]&&(t[e]=a.getFullYear()+"-"+i(a.getMonth()+1)+"-"+i(a.getDate())+" "+i(a.getHours())+":"+i(a.getMinutes())+":"+i(a.getSeconds()))}catch(t){}}),t},LadiPageScriptV2.prototype.runFormItemOtherChange=function(t,e){var i=this,a=i.findAncestor(t,"ladi-element");if(!isEmptyLadiPage(a)){var n=function(i){var n=null;if(e)for(var o=a.querySelectorAll('.ladi-form-checkbox-item input[data-other="true"]'),d=0;d0;)V=A.shift(),o.fireEvent(V,"change");for(;T.length>0;)V=T.shift(),o.runtime.tmp.fireEventLabelChange(V);for(w=document.querySelectorAll(".ladi-form .ladi-form-label-container"),S=0;S0){var r=n?0:l.getProductVariantIndex(null,a);isEmptyLadiPage(o)||(r=u.product.variants.findIndex(function(t){return t.product_variant_id==o}));var y=null;if(-1!=r&&(y=u.product.variants[r],p=y),!t)if(-1!=r)if(-1!=["variant_start_date","variant_end_date"].indexOf(c))g=LadiPageScript.convertDataDate({date:y[c]},["date"]),m=g.date,e=m;else if(-1!=["sku","variant_timezone"].indexOf(c))m=y[c],e=m;else if(-1!=["title"].indexOf(c))m=y[c]||y.product_name,e=m;else if(-1!=["text_quantity"].indexOf(c))m=1==y.inventory_checked?y[c]:"haravan"==y.inventory_checked?y.quantity:"",e=m;else if(-1!=["weight"].indexOf(c))m=y[c],isEmptyLadiPage(y.weight_unit)||(m+=y.weight_unit),e=m;else if(-1!=["price","compare_price"].indexOf(c))isEmptyLadiPage(y[c])?m="":(m=l.formatNumber(y[c],3),isObjectLadiPage(u.store_info)&&isObjectLadiPage(u.store_info.currency)&&!isEmptyLadiPage(u.store_info.currency.symbol)&&(m=l.formatCurrency(y[c],u.store_info.currency.symbol,!0))),e=m;else if(-1!=["price_sale"].indexOf(c)){var h=0;isEmptyLadiPage(y.price)||isEmptyLadiPage(y.compare_price)||(h=y.compare_price-y.price),0!=h?(m=l.formatNumber(h,3),isObjectLadiPage(u.store_info)&&isObjectLadiPage(u.store_info.currency)&&!isEmptyLadiPage(u.store_info.currency.symbol)&&(m=l.formatCurrency(h,u.store_info.currency.symbol,!0))):m="",e=m}else if(-1!=["price_sale_percent"].indexOf(c)){var f=0;isEmptyLadiPage(y.price)||isEmptyLadiPage(y.compare_price)||(f=Math.floor((y.compare_price-y.price)/y.compare_price*100)),e=m=0!=f?f+"%":""}else if(-1!=["src"].indexOf(c)){if(m=y[c],isEmptyLadiPage(m))return c="image",_();!isStringLadiPage(m)||m.startsWith("http://")||m.startsWith("https://")||m.startsWith("//")||(m="https://"+l.const.STATIC_W_DOMAIN+"/"+m),e=m}else["description"].indexOf(c),m=y[c],isEmptyLadiPage(m)||(e=m);else e=m=""}}else m=u.product[c],isBooleanLadiPage(m)?m=m?l.const.LANG.OPTION_TRUE:l.const.LANG.OPTION_FALSE:(g=LadiPageScript.convertDataDate({date:m},["date"]),m=g.date),e=m;!i&&isFunctionLadiPage(d)&&d(e)};_()}return t?{product:u,variant:p,value:e}:e},LadiPageScriptV2.prototype.generateVariantProduct=function(t,e,i,a,n,o,r,d,l){var s=e?"":null,c=this,u=function(t){if(!e)return isObjectLadiPage(t)?t:null;var d="";if(isObjectLadiPage(t)){if(!isObjectLadiPage(t.product))return d;i==c.const.PRODUCT_VARIANT_TYPE.combined&&(d+='
",c.runtime.isClient&&(d+='"),isArrayLadiPage(t.product.variants)&&t.product.variants.forEach(function(e,i){var a=e.title||e.product_name;if(n){var o=c.formatNumber(e.price,3);isObjectLadiPage(t.store_info)&&isObjectLadiPage(t.store_info.currency)&&!isEmptyLadiPage(t.store_info.currency.symbol)&&(o=c.formatCurrency(e.price,t.store_info.currency.symbol,!0)),a+=" - "+o}d+='"}),d+="
"),i==c.const.PRODUCT_VARIANT_TYPE.combobox&&isArrayLadiPage(t.product.options)&&t.product.options.forEach(function(e){if(e.is_tmp)d+='
';else if(isArrayLadiPage(e.values)&&0!=e.values.length){d+='
',isEmptyLadiPage(a)||(d+='
'+e.name+"
"),d+='
",c.runtime.isClient&&(d+='");var i=null;isArrayLadiPage(t.product.variants)&&(i=t.product.variants[0]);var n=null;isEmptyLadiPage(i)||isStringLadiPage(i.option_ids)&&(n=i.option_ids.split("/"));e.values.forEach(function(t){var a=function(t){var a="";return isArrayLadiPage(n)&&n.forEach(function(n,o){e.product_option_id==n&&t==i["option"+(o+1)]&&(a=" selected")}),a}(t.name);d+="'+(t.name_new||t.name)+""}),d+="
"}}),i==c.const.PRODUCT_VARIANT_TYPE.label&&isArrayLadiPage(t.product.options)&&t.product.options.forEach(function(e){if(isArrayLadiPage(e.values)&&0!=e.values.length){d+='
',isEmptyLadiPage(a)||(d+='
',d+=""+e.name+"",d+=''+(r?"":e.values[0].name)+"",d+="
"),d+='
';var i=null;isArrayLadiPage(t.product.variants)&&(i=t.product.variants[0]);var n=null;isEmptyLadiPage(i)||isStringLadiPage(i.option_ids)&&(n=i.option_ids.split("/"));e.values.forEach(function(t,a){0==a&&(t.type==c.const.PRODUCT_VARIANT_OPTION_TYPE.image?d+='
':t.type==c.const.PRODUCT_VARIANT_OPTION_TYPE.color?d+='
':d+='
 
');var o=function(t){var a="";return isArrayLadiPage(n)&&n.forEach(function(n,o){e.product_option_id==n&&t==i["option"+(o+1)]&&(a=" selected")}),a}(t.name);if(t.type==c.const.PRODUCT_VARIANT_OPTION_TYPE.image){var r=t.value;isEmptyLadiPage(r)||!isStringLadiPage(r)||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||(r="https://"+c.const.STATIC_W_DOMAIN+"/"+r),r=c.getOptimizeImage(r,100,100,!1,!1,!1,!0),d+=`
'}else t.type==c.const.PRODUCT_VARIANT_OPTION_TYPE.color?d+='
':d+='
'+(t.name_new||t.name)+"
"}),d+="
"}})}return d};if(!isNullLadiPage(t.dataProduct))return u(t.dataProduct);var p=t["option.form_account_id"],m=t["option.product_type"],g=t["option.ladisale_store_id"]||null,_=t["option.product_id"],y=t["option.data_setting.value"],h=t["option.data_setting.type_dataset"],f=t["option.data_setting.sort_name"],v=t["option.data_setting.sort_by"],E=null,P=null;if(-1!=[c.const.FORM_CONFIG_TYPE.ladisales,c.const.FORM_CONFIG_TYPE.sapo,c.const.FORM_CONFIG_TYPE.haravan,c.const.FORM_CONFIG_TYPE.shopify,c.const.FORM_CONFIG_TYPE.wordpress].indexOf(m)){if(!isEmptyLadiPage(_)){isEmptyLadiPage(c.runtime.tmp.product_info[m])&&(c.runtime.tmp.product_info[m]={}),isEmptyLadiPage(c.runtime.tmp.timeout_product_info[m])&&(c.runtime.tmp.timeout_product_info[m]={});var L=_;if(_=parseInt(_)||_,E=c.runtime.tmp.product_info[m][_],P=function(){return u(E)},isNullLadiPage(E)){c.runtime.tmp.product_info[m][_]=!0;var b=function(){c.runtime.tmp.product_info[m][_]=!1,isEmptyLadiPage(c.runtime.tmp.timeout_product_info[m][_])||(c.removeTimeout(c.runtime.tmp.timeout_product_info[m][_]),delete c.runtime.tmp.timeout_product_info[m][_])},A=function(t){if(E=isObjectLadiPage(c.runtime.tmp.product_info[m][_])?c.runtime.tmp.product_info[m][_]:t.data,isObjectLadiPage(E)){if(!isObjectLadiPage(E.store_info)){var e=c.runtime.currency;c.runtime.isClient||(e=window.$rootScope.getStoreCurrency()),E.store_info={currency:{code:e,symbol:c.formatCurrency(null,e,!1,!0)}}}if(m!=c.const.FORM_CONFIG_TYPE.ladisales&&(E.store_info.id=-1),isObjectLadiPage(E.store_info.currency)&&!isEmptyLadiPage(E.store_info.currency.code)&&(E.store_info.currency.symbol=c.formatCurrency(null,E.store_info.currency.code,!1,!0)),isObjectLadiPage(E.product)&&isArrayLadiPage(E.product.options)&&isArrayLadiPage(E.product.variants)){var i=E.product.options.map(function(t){return t.product_option_id});if(i=i.join("/"),-1!=[c.const.FORM_CONFIG_TYPE.ladisales].indexOf(m)&&1==E.product.options.length&&isObjectLadiPage(E.product.options[0])&&isArrayLadiPage(E.product.options[0].values)&&E.product.variants.length==E.product.options[0].values.length&&(E.product.type==c.const.PRODUCT_TYPE.event||E.product.type==c.const.PRODUCT_TYPE.service)){for(var a=[],n=0;n0&&n.push(this.const.LANG.HIDE_ELEMENT+" "+t.dynamic_content.hide.join(", ")),isArrayLadiPage(t.dynamic_content.show)&&t.dynamic_content.show.length>0&&n.push(this.const.LANG.SHOW_ELEMENT+" "+t.dynamic_content.show.join(", ")),isArrayLadiPage(t.dynamic_content.top)&&t.dynamic_content.top.length>0&&n.push(this.const.LANG.TOP_ELEMENT+" "+t.dynamic_content.top.join(", ")),isArrayLadiPage(t.dynamic_content.scroll)&&t.dynamic_content.scroll.length>0&&n.push(this.const.LANG.SCROLL_ELEMENT+" "+t.dynamic_content.scroll.join(", ")),isArrayLadiPage(t.dynamic_content.cookie)&&t.dynamic_content.cookie.length>0&&n.push(this.const.LANG.SET_COOKIE+" "+t.dynamic_content.cookie.join("; ")))}catch(t){}return a?n:n.join(i)},LadiPageScriptV2.prototype.checkDataTypeWebsiteValue=function(t){return t==this.const.DATA_TYPE.list_category||t==this.const.DATA_TYPE.list_tag||t==this.const.DATA_TYPE.list_post_by_category||t==this.const.DATA_TYPE.list_post_by_tag||t==this.const.DATA_TYPE.list_post_by_keyword},LadiPageScriptV2.prototype.loadCollectionData=function(t,e,i,a,n,o){var r=this,d=function(t,e,i,a,n,o){var l=!isEmptyLadiPage(e["option.product_mapping_name"]),s=JSON.stringify(e),c=null,u=null;if(l)if(a&&isEmptyLadiPage(i))c="";else if(!isEmptyLadiPage(e["option.product_id"])&&s===(c=(u=r.generateProductKey(!0,s,!0,e,!0,i,null,function(r){d(t,e,i,a,n,o)})).value))return;var p=e.type,m=null,g=null;if(l&&"headline"==p&&(g=t.getElementsByClassName("ladi-headline")[0],isEmptyLadiPage(g)||(g.innerHTML=isNullLadiPage(c)?"":c)),l&&"paragraph"==p&&(g=t.getElementsByClassName("ladi-paragraph")[0],isEmptyLadiPage(g)||(g.innerHTML=isNullLadiPage(c)?"":c)),l&&"image"==p){m=r.getOptimizeImage(c,t.clientWidth,t.clientHeight,!0,!1,!1,!0);var _=t.getElementsByClassName("ladi-image-background")[0];isEmptyLadiPage(_)||(isEmptyLadiPage(m)?_.style.setProperty("background-image","none"):_.style.setProperty("background-image",'url("'+m+'")'))}if("gallery"==p){if(l&&!isArrayLadiPage(c))return;if(o&&!n&&"true"==t.getAttribute("data-collection"))return void r.runtime.tmp.updateImageGalleryProduct(t,u,e);t.setAttribute("data-collection",!0),t.removeAttribute("data-stop"),t.removeAttribute("data-loaded"),t.removeAttribute("data-scrolled"),t.removeAttribute("data-current"),t.removeAttribute("data-is-next"),t.removeAttribute("data-runtime-id"),t.removeAttribute("data-next-time");var y=t.querySelector(".ladi-gallery-view-item.selected");isEmptyLadiPage(y)||y.classList.remove("selected");var h=t.querySelector(".ladi-gallery-control-item.selected");isEmptyLadiPage(h)||h.classList.remove("selected");var f=t.getElementsByClassName("ladi-gallery-view")[0];h=t.getElementsByClassName("ladi-gallery-control-item")[0],y=t.getElementsByClassName("ladi-gallery-view-item")[0],isEmptyLadiPage(y)||y.classList.add("selected"),isEmptyLadiPage(h)||h.classList.add("selected");var v=t.getElementsByClassName("ladi-gallery-control-box")[0];if(isEmptyLadiPage(v)||v.style.removeProperty("left"),l){for(var E=t.getElementsByClassName("ladi-gallery-view-item");E.length',null,!0);t.getElementsByClassName("ladi-gallery-view")[0].appendChild(P)}for(;E.length>c.length;)E[E.length-1].parentElement.removeChild(E[E.length-1]);for(var L=t.getElementsByClassName("ladi-gallery-control-item"),b=function(e){r.runtime.tmp.eventClickGalleryControlItem(e,t)};L.length',null,!0);A.addEventListener("click",b),t.getElementsByClassName("ladi-gallery-control-box")[0].appendChild(A)}for(;L.length>c.length;)L[L.length-1].parentElement.removeChild(L[L.length-1]);for(var T=t.querySelectorAll(".ladi-gallery .ladi-gallery-view .ladi-gallery-view-arrow"),w=0;w .ladi-gallery-control"),w=0;w .ladi-gallery-view"),w=0;w0&&t!=n)){e.style.setProperty("height",n+"px");var b=r.findAncestor(e,"ladi-form");isEmptyLadiPage(b)||(b=r.findAncestor(b,"ladi-element"),r.updateHeightElement(!0,e,b,t,n))}})}if(a["option.input_type"]==r.const.INPUT_TYPE.number){var g=e.querySelector('input[name="quantity"]'),_=function(t){if(!isEmptyLadiPage(t.target.value)){var e=r.generateVariantProduct(i,!1,null,null,null,null,!0,!0,function(){_(t)});if(!(isEmptyLadiPage(e)||isEmptyLadiPage(e.store_info)||isEmptyLadiPage(e.product))){var a=t.target;a=(a=r.findAncestor(a,"ladi-form")).querySelector('[data-variant="true"]');var n=r.getProductVariantId(a,e.product),o=e.product.variants.findIndex(function(t){return t.product_variant_id==n});if(-1!=o){var d=e.product.variants[o].quantity,l=e.product.variants[o].quantity_stock;d=isNullLadiPage(l)?d:l;var s=parseInt(t.target.value)||0,c=1;c=e.product.variants[o].min_buy||c;var u=e.product.variants[o].max_buy,p=0,m=r.runtime.tmp.cart.findIndex(function(t){return t.product_id==e.product.variants[o].product_id&&t.product_variant_id==e.product.variants[o].product_variant_id});-1!=m&&(p=r.runtime.tmp.cart[m].quantity),c>s+p&&(s=c-p),1==e.product.variants[o].inventory_checked&&s+p>d&&(s=d-p),!isEmptyLadiPage(u)&&s+p>u&&(s=u-p),s=s<1?1:s,t.target.setAttribute("min",c),isEmptyLadiPage(u)||t.target.setAttribute("max",u),t.target.value=s}}}};g.addEventListener("input",_),r.fireEvent(g,"input");var y=e.querySelectorAll(".button")[0],h=e.querySelectorAll(".button")[1];if(isEmptyLadiPage(y)||isEmptyLadiPage(h))return;y.addEventListener("click",function(t){r.removeTimeout(r.runtime.tmp.timeout_button_quantity_cart_id),r.runtime.tmp.timeout_button_quantity_cart_id=r.runTimeout(function(){g.value=(parseFloatLadiPage(g.value)||0)-1,r.fireEvent(g,"input")},10)}),h.addEventListener("click",function(t){r.removeTimeout(r.runtime.tmp.timeout_button_quantity_cart_id),r.runtime.tmp.timeout_button_quantity_cart_id=r.runTimeout(function(){g.value=(parseFloatLadiPage(g.value)||0)+1,r.fireEvent(g,"input")},10)})}if("button"==a.type&&(a["option.is_buy_now"]||a["option.is_add_to_cart"])){var f=function(){var t=i["option.data_event"];if(!isArrayLadiPage(t)&&(t=[],isObjectLadiPage(i["option.data_action"]))){var a=r.copy(i["option.data_action"]);a.action_type=r.const.ACTION_TYPE.action,t.push(a)}t.forEach(function(t){t.action_type==r.const.ACTION_TYPE.action&&(t.type==r.const.DATA_ACTION_TYPE.popup_cart&&(window.ladi("POPUP_CART").show(),r.runEventTracking(e.id,{is_form:!1})),t.type==r.const.DATA_ACTION_TYPE.popup_checkout&&(r.runtime.shopping_third_party?r.getThirdPartyCheckoutUrl(!0,null,{event:{target:e}}):window.ladi("POPUP_CHECKOUT").show(!1,{event:{target:e}}),r.runEventTracking(e.id,{is_form:!1})))})};e.setAttribute("data-click",!1),e.addEventListener("click",function(t){r.runtime.tmp.buttonAddToCartClick(t,!0,i,f)})}},P=function(t,e){var g=h*f;r.checkDataTypeWebsiteValue(p)&&isEmptyLadiPage(u)&&(y!=r.const.COLLECTION_LIST_TYPE.horizontal&&y!=r.const.COLLECTION_LIST_TYPE.vertical||(g=1e3));var _=null;if(_=r.getListProductByTagId(e,g,i,!0,function(){P(t,e)}),isObjectLadiPage(_)&&isArrayLadiPage(_.products)){var L=m.getElementById(t);if(isEmptyLadiPage(L))return;if(L.getAttribute("data-page")==i&&1!=i)return;var b=i,A=!1,T=!1;if(!isEmptyLadiPage(_.total_record)&&i*g>=_.total_record){if(u==r.const.COLLECTION_TYPE.readmore){var w=L.getElementsByClassName("ladi-collection-button-next")[0];isEmptyLadiPage(w)||w.setAttribute("data-opacity","0")}L.setAttribute("data-max-page",b),A=!0,i*g>_.total_record&&(T=!0)}L.setAttribute("data-page",i>b?b:i);var S=L.getElementsByClassName("ladi-collection-arrow-left")[0],O=L.getElementsByClassName("ladi-collection-arrow-right")[0],k=L.getElementsByClassName("ladi-collection-button-next")[0];if(isEmptyLadiPage(S)||S.classList.remove("opacity-0"),isEmptyLadiPage(O)||O.classList.remove("opacity-0"),isEmptyLadiPage(k)||k.classList.remove("opacity-0"),1==L.getAttribute("data-page")&&u==r.const.COLLECTION_TYPE.carousel&&(isEmptyLadiPage(S)||S.classList.add("opacity-0")),L.getAttribute("data-page")==L.getAttribute("data-max-page")&&(u==r.const.COLLECTION_TYPE.readmore&&(isEmptyLadiPage(k)||k.classList.add("opacity-0")),u==r.const.COLLECTION_TYPE.carousel&&(isEmptyLadiPage(O)||O.classList.add("opacity-0"))),bI&&(I=D.length)}}var R=L.getElementsByClassName("ladi-collection-content")[0],B={className:C[0].className,innerHTML:C[0].innerHTML};a&&C[0].parentElement.removeChild(C[0]);for(var M=R.getElementsByClassName("ladi-collection-page");M.length0;)V[0].parentElement.removeChild(V[0]);var U=function(t,i,a,n,u,p){isEmptyLadiPage(i.id)&&!isEmptyLadiPage(i.product_id)&&(i.id=i.product_id);for(var m=0;mI&&(I=_.products[N].options.length);for(L.setAttribute("data-max-option-length",I),N=0;N<_.products.length;N++)if(!(V.length>N)){var Y=document.createElement("div");Y.className=B.className,F.appendChild(Y),Y.innerHTML=B.innerHTML;for(var H=Y.getElementsByClassName("ladi-element");isArrayLadiPage(_.products[N].options)&&_.products[N].options.length0?(n="calc("+a+" * "+d.length+" - ("+a+" / "+f+" * "+s+") + calc("+v+"px / "+f+" * "+l.length+"))",o>1&&(o!=d.length?i="calc(-"+a+" * "+(o-1)+")":(i="calc(-"+a+" * "+(o-1)+" + ("+a+" / "+f+" * "+s+"))",u="margin-left: calc(-"+v+"px / "+f+" * "+l.length+");")),c+="#"+t+" .ladi-collection .ladi-collection-content .ladi-collection-page.last.not-full .ladi-collection-item:first-child {",c+="margin-left: "+v+"px;",c+="}",c+="#"+t+" .ladi-collection-content .ladi-collection-page.last {",c+="width: calc("+getComputedStyle(e).width+" / "+f+" * "+l.length+" + calc("+v+"px / "+f+" * "+l.length+")) !important;",c+="}"):(o>1&&(i="calc(-"+a+" * "+(o-1)+")"),n="calc("+a+" * "+d.length+")");var p="style_collection_"+t,g=m.getElementById(p);isEmptyLadiPage(g)||g.parentElement.removeChild(g);var _="#"+t+" .ladi-collection-content {";_+="width: "+n+";",_+="left: "+i+";",_+=u,_+="}",_+=c,r.createStyleElement(p,_)}}(t),n&&u==r.const.COLLECTION_TYPE.readmore&&function(t){var e=m.getElementById(t);if(!isEmptyLadiPage(e)){var i=e.getElementsByClassName("ladi-collection-content")[0];if(e.hasAttribute("data-max-page")){var a=i.querySelector(".ladi-collection-page.last"),n=a.getElementsByClassName("ladi-collection-item"),o=Math.ceil(n.length/f);if(h==o)a.style.removeProperty("height");else{var d=parseFloatLadiPage((parseFloatLadiPage(getComputedStyle(a).height)||0)*o/h)||0;d-=parseFloatLadiPage(v*(h-o)/h)||0,a.style.setProperty("height",d+"px")}}var l=parseFloatLadiPage(getComputedStyle(e).height)||0,s=i.scrollHeight;if(l!=s){e.style.setProperty("height",s+"px");var c=r.findAncestor(e.parentElement,"ladi-element");isEmptyLadiPage(c)&&(c=r.findAncestor(e.parentElement,"ladi-section")),r.updateHeightElement(!0,e,c,l,s)}}}(t),r.runEventScroll(),r.runResizeAll()}},L=g["option.product_tag_id"],b=g["option.data_setting.value"];(o.is_generate_template||isArrayLadiPage(L)||!isEmptyLadiPage(b))&&P(t,g)}},LadiPageScriptV2.prototype.getListProductByTagId=function(t,e,i,a,n){var o=this,r=t["option.form_account_id"],d=t["option.product_type"],l=t["option.ladisale_store_id"]||null,s=t["option.product_tag_id"],c=t["option.data_setting.value"],u=t["option.data_setting.type_dataset"],p=t["option.collection_setting.type"],m=t["option.data_setting.sort_name"],g=t["option.data_setting.sort_by"],_=null,y=null,h=null,f=null,v=null;if(isArrayLadiPage(s)&&s.length>0){if(isEmptyLadiPage(o.runtime.tmp.product_tag_info[d])&&(o.runtime.tmp.product_tag_info[d]={}),isEmptyLadiPage(o.runtime.tmp.timeout_product_tag_info[d])&&(o.runtime.tmp.timeout_product_tag_info[d]={}),s.sort(),h=JSON.stringify(s)+"_page_"+i+"_limit_"+e,f=o.runtime.tmp.product_tag_info[d][h],-1!=[o.const.FORM_CONFIG_TYPE.ladisales,o.const.FORM_CONFIG_TYPE.sapo,o.const.FORM_CONFIG_TYPE.haravan,o.const.FORM_CONFIG_TYPE.shopify,o.const.FORM_CONFIG_TYPE.wordpress].indexOf(d)){y=function(){var t=null;return isObjectLadiPage(f)&&isArrayLadiPage(f.products)&&(t={products:f.products,total_record:f.total_record},isEmptyLadiPage(o.runtime.tmp.product_info[d])&&(o.runtime.tmp.product_info[d]={}),t.products.forEach(function(t){o.runtime.tmp.product_info[d][t.product_id]={store_info:f.store_info,product:t}})),t};var E=null;if(isStringLadiPage(f)&&(E=f,f=null),isNullLadiPage(f)){o.runtime.tmp.product_tag_info[d][h]=!0;var P=function(){o.runtime.tmp.product_tag_info[d][h]=!1,isEmptyLadiPage(o.runtime.tmp.timeout_product_tag_info[d][h])||(o.removeTimeout(o.runtime.tmp.timeout_product_tag_info[d][h]),delete o.runtime.tmp.timeout_product_tag_info[d][h])},L=function(t){if(f=t.data,isObjectLadiPage(f)){if(!isObjectLadiPage(f.store_info)){var a=o.runtime.currency;o.runtime.isClient||(a=window.$rootScope.getStoreCurrency()),f.store_info={currency:{code:a,symbol:o.formatCurrency(null,a,!1,!0)}}}if(d!=o.const.FORM_CONFIG_TYPE.ladisales&&(f.store_info.id=-1),isObjectLadiPage(f.store_info.currency)&&!isEmptyLadiPage(f.store_info.currency.code)&&(f.store_info.currency.symbol=o.formatCurrency(null,f.store_info.currency.code,!1,!0)),isArrayLadiPage(f.products))for(var r=null,l=function(t){return t.option1==r},c=0;c0&&isArrayLadiPage(e.variants)&&e.variants.length>0&&isObjectLadiPage(t.variants[0])&&t.variants[0].hasOwnProperty(m)&&isObjectLadiPage(e.variants[0])&&e.variants[0].hasOwnProperty(m)?g==o.const.SORT_BY_TYPE.asc?t.variants[0][m]-e.variants[0][m]:e.variants[0][m]-t.variants[0][m]:0}),w),_=y(),isFunctionLadiPage(n)&&n(_)}else P();var w},b={product_tag_ids:s,limit:e};isEmptyLadiPage(p)?b.type="group":b.paged=i,isEmptyLadiPage(m)||isEmptyLadiPage(g)||(b.sort={},b.sort[m]=g==o.const.SORT_BY_TYPE.desc?-1:1);var A=null,T="POST";return o.runLimitRequest(20,function(){if(o.runtime.isClient){var a="",n=o.const.API_LADISALE_COLLECTION_PRODUCT;d==o.const.FORM_CONFIG_TYPE.ladisales?(a=JSON.stringify([b.product_tag_ids,b.limit,b.type,b.paged,l,d]),(A={"Content-Type":"application/json"})["Store-Id"]=l,b=JSON.stringify(b)):d==o.const.FORM_CONFIG_TYPE.wordpress?(T="GET",n=window.location.origin+"/ladipage/api?action=product_list&category_ids="+s.join("|")+"&page="+i+"&limit="+e,b=null):(A={"Content-Type":"application/json"},n=o.const.API_COLLECTION_PRODUCT,b={form_account_id:r,tags:s,limit:e},isEmptyLadiPage(E)?b.page=i:b.page_info=E,a=JSON.stringify([b.form_account_id,b.tags,b.limit,b.page_info,b.page,d]),b=JSON.stringify(b)),!isEmptyLadiPage(a)&&isObjectLadiPage(o.runtime.tmp.product_data_website)&&isObjectLadiPage(o.runtime.tmp.product_data_website[a])?L({data:o.runtime.tmp.product_data_website[a]}):o.sendRequest(T,n,b,!0,A,function(t,e,i){if(i.readyState==XMLHttpRequest.DONE)try{var a=JSON.parse(t);L(a)}catch(t){P()}})}else{var c=function(t){if(isArrayLadiPage(t)&&t.length>1){var e={products:[]};t.forEach(function(t){if(isNullLadiPage(t.product)&&!isNullLadiPage(t.store_info)&&!isNullLadiPage(t.total_record))return e.store_info=t.store_info,void(e.total_record=t.total_record);isNullLadiPage(t.product)||e.products.push(t.product)}),L({data:e})}},u=LadiPage.mapping_attribute_option_product_id(t.element,"",!1,s,e,i,!0,function(t){c(t)});c(u)}}),_}}}else isEmptyLadiPage(c)||(y=function(){var t=null;if(isArrayLadiPage(v)){var a=o.copy(v);t={products:a=a.splice((i-1)*e,e),total_record:v.length},isEmptyLadiPage(o.runtime.tmp.product_info[d])&&(o.runtime.tmp.product_info[d]={}),v.forEach(function(t){o.runtime.tmp.product_info[d][t.id]={store_info:{},product:t}})}return t},v=o.loadDataset(c,c,u,m,g,!0,o.runtime.isClient,function(t){v=t,_=y(),isFunctionLadiPage(n)&&n(_)}));return isFunctionLadiPage(y)&&(!0===f?o.runtime.tmp.timeout_product_tag_info[d][h]=o.runTimeout(function(){o.getListProductByTagId(t,e,i,!1,n)},100):(_=y(),!a&&isFunctionLadiPage(n)&&n(_))),_},LadiPageScriptV2.prototype.getListLadiSalesProductByIds=function(t,e){var i=this,a=JSON.stringify(t);isObjectLadiPage(i.runtime.tmp.list_product_ladisales_by_ids)||(i.runtime.tmp.list_product_ladisales_by_ids={});var n=i.runtime.tmp.list_product_ladisales_by_ids[a];if(isArrayLadiPage(n))return i.copy(n);if(!0!==n){var o=i.const.API_LADISALE_PRODUCT_SHOW_LIST,r={product_variants_ids:t,ladi_uid:$rootScope.store.ladi_uid};i.runtime.tmp.list_product_ladisales_by_ids[a]=!0;var d={"Content-Type":"application/json"};i.runLimitRequest(20,function(){i.sendRequest("POST",o,JSON.stringify(r),!0,d,function(o,r,d){if(d.readyState==XMLHttpRequest.DONE){try{var l=JSON.parse(o);n=200==l.code?l.data:[]}catch(t){}isFunctionLadiPage(e)&&e(n),i.runtime.tmp.list_product_ladisales_by_ids[a]=n,i.getListLadiSalesProductByIds(t,e)}})})}else i.runTimeout(function(){i.getListLadiSalesProductByIds(t,e)},100)},LadiPageScriptV2.prototype.changeTotalPriceCart=function(t){var e=0,i=0;this.runtime.tmp.cart.forEach(function(t){i+=t.quantity,isObjectLadiPage(t.promotion)?e+=t.promotion.total:e+=t.price*t.quantity}),e=e<0?0:e;var a=this.runtime.tmp.add_to_cart_fee_shipping||0,n=this.runtime.tmp.add_to_cart_discount||0,o=e+a-n;if(o=o<0?0:o,t)return{cart_price:e,cart_checkout_price:o,cart_fee_shipping:a,cart_discount:n,total_quantity:i};var r=this.formatNumber(e,3),d=this.formatNumber(o,3),l=this.formatNumber(a,3),s=this.formatNumber(n,3);if(this.runtime.tmp.cart.length>0&&!isEmptyLadiPage(this.runtime.tmp.cart[0].currency)&&!isEmptyLadiPage(this.runtime.tmp.cart[0].currency.symbol)){var c=this.runtime.tmp.cart[0].currency.symbol;r=this.formatCurrency(e,c,!0),d=this.formatCurrency(o,c,!0),l=this.formatCurrency(a,c,!0),s=this.formatCurrency(n,c,!0)}this.setDataReplaceStr("cart_price",r),this.setDataReplaceStr("cart_checkout_price",d),this.setDataReplaceStr("cart_fee_shipping",l),this.setDataReplaceStr("cart_discount",s),this.setDataReplaceStr("cart_quantity",i),this.setDataReplaceElement(!1)},LadiPageScriptV2.prototype.runAnimationDoc=function(t,e,i){var a=this;if(!isEmptyLadiPage(t)){if(isEmptyLadiPage(e)&&!isEmptyLadiPage(t.id)&&(e=a.runtime.eventData[t.id]),isNullLadiPage(i.is_child)&&(i.is_child=!1),isNullLadiPage(i.run_timeout)&&(i.run_timeout=!0),"carousel"==i.element_type){var n=a.findAncestor(t,"ladi-carousel");if(n=isEmptyLadiPage(n)?t:a.findAncestor(n,"ladi-element"),i.is_child&&!isEmptyLadiPage(n)&&i.run_timeout){var o=n.getElementsByClassName("ladi-carousel-content")[0],r=a.runtime.eventData[n.id],d=null,l=null,s=getComputedStyle(o).transitionProperty.split(",");s=s.removeSpace();var c=getComputedStyle(o).transitionDuration.split(",");c=c.removeSpace();var u={};return s.forEach(function(t,e){u[t]=1e3*(parseFloatLadiPage(c[e])||0)}),void(isEmptyLadiPage(r)||r[a.runtime.device+".option.carousel_setting.display_type"]!=a.const.CAROUSEL_DISPLAY_TYPE.vertical?a.runTimeout(function(){d=a.getElementBoundingClientRect(t),l=a.getElementBoundingClientRect(n),(d.x>=l.x&&d.x<=l.x+l.width||d.x+d.width>=l.x&&d.x+d.width<=l.x+l.width)&&(i.run_timeout=!1,a.runAnimationDoc(t,e,i))},u.left+100):a.runTimeout(function(){d=a.getElementBoundingClientRect(t),l=a.getElementBoundingClientRect(n),(d.y>=l.y&&d.y<=l.y+l.height||d.y+d.width>=l.y&&d.y+d.width<=l.y+l.height)&&(i.run_timeout=!1,a.runAnimationDoc(t,e,i))},u.top+100))}}else t.classList.contains("ladi-animation")&&t.classList.add("ladi-animation-hidden");if(t.classList.contains("ladi-animation-hidden")){var p=isObjectLadiPage(e)&&parseFloatLadiPage(e[a.runtime.device+".style.animation-delay"])||0;t.classList.add("ladi-animation"),a.runTimeout(function(){t.classList.remove("ladi-animation-hidden")},1e3*p)}if(i.is_multiple){var m=[];m="carousel"==i.element_type?t.querySelectorAll(".ladi-carousel .ladi-animation, .ladi-animation-hidden"):t.querySelectorAll(".ladi-animation, .ladi-animation-hidden"),i.is_child=!0;for(var g=0;gm?m:p,c.style.setProperty("width",p+"px"),u.style.setProperty("left","calc("+p+"px - "+u.clientWidth+"px / 2 - 3px / 2)")}return isEmptyLadiPage(e.runtime.current_element_mouse_down_carousel)||(i=document.getElementById(e.runtime.current_element_mouse_down_carousel),l=e.runtime.eventData[i.id],isObjectLadiPage(l)&&isEmptyLadiPage(l["option.meta_data.version"])&&(((a=t.pageX-e.runtime.current_element_mouse_down_carousel_position_x)>=e.runtime.mouse_down_diff_touch_action||-1*a>=e.runtime.mouse_down_diff_touch_action)&&(e.runtime.tmp.is_grab=!0),n=parseFloatLadiPage(i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-left"))||0,(n+=a)<(r=-((parseFloatLadiPage(e.runtime.eventData[e.runtime.current_element_mouse_down_carousel][e.runtime.device+".option.carousel_crop.width"])||0)-i.clientWidth))&&(n=r),n>0&&(n=0),a>=e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-left")[0].click()):a<=-e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-right")[0].click()):i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("left",n+"px")),isObjectLadiPage(l)&&l["option.meta_data.version"]==e.const.META_VERSION.two&&(l[e.runtime.device+".option.carousel_setting.display_type"]==e.const.CAROUSEL_DISPLAY_TYPE.horizontal&&(((a=t.pageX-e.runtime.current_element_mouse_down_carousel_position_x)>=e.runtime.mouse_down_diff_touch_action||-1*a>=e.runtime.mouse_down_diff_touch_action)&&(e.runtime.tmp.is_grab=!0),n=parseFloatLadiPage(i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-left"))||0,(n+=a)<(r=-((parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-carousel-content")[0]).width)||0)-i.clientWidth))&&(n=r),n>0&&(n=0),a>=e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-left")[0].click()):a<=-e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-right")[0].click()):i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("left",n+"px")),l[e.runtime.device+".option.carousel_setting.display_type"]==e.const.CAROUSEL_DISPLAY_TYPE.vertical&&(((a=t.pageY-e.runtime.current_element_mouse_down_carousel_position_y)>=e.runtime.mouse_down_diff_touch_action||-1*a>=e.runtime.mouse_down_diff_touch_action)&&(e.runtime.tmp.is_grab=!0),o=parseFloatLadiPage(i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-top"))||0,(o+=a)<(d=-((parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-carousel-content")[0]).height)||0)-i.clientHeight))&&(o=d),o>0&&(o=0),a>=e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-left")[0].click()):a<=-e.runtime.current_element_mouse_down_carousel_diff?(delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,i.getElementsByClassName("ladi-carousel-arrow-right")[0].click()):i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("top",o+"px")))),isEmptyLadiPage(e.runtime.current_element_mouse_down_gallery_view)||(i=document.querySelector('[data-runtime-id="'+e.runtime.current_element_mouse_down_gallery_view+'"]'),((a=t.pageX-e.runtime.current_element_mouse_down_gallery_view_position_x)>=e.runtime.mouse_down_diff_touch_action||-1*a>=e.runtime.mouse_down_diff_touch_action)&&(e.runtime.tmp.is_grab=!0),(s=parseFloatLadiPage(i.getAttribute("data-current"))||0)==(parseFloatLadiPage(i.getAttribute("data-max-item"))||0)-1&&a<0&&(a=0),a>0&&0==s&&(a=0),a>=e.runtime.current_element_mouse_down_gallery_view_diff?(e.runtime.current_element_mouse_down_gallery_view=null,e.runtime.current_element_mouse_down_gallery_view_position_x=0,e.runtime.current_element_mouse_down_gallery_view_position_y=0,i.getElementsByClassName("ladi-gallery-view-arrow-left")[0].click()):a<=-e.runtime.current_element_mouse_down_gallery_view_diff?(e.runtime.current_element_mouse_down_gallery_view=null,e.runtime.current_element_mouse_down_gallery_view_position_x=0,e.runtime.current_element_mouse_down_gallery_view_position_y=0,i.getElementsByClassName("ladi-gallery-view-arrow-right")[0].click()):i.querySelectorAll(".ladi-gallery-view-item.selected").length>0&&i.querySelectorAll(".ladi-gallery-view-item.selected")[0].style.setProperty("left",a+"px")),isEmptyLadiPage(e.runtime.current_element_mouse_down_gallery_control)||(i=document.querySelector('[data-runtime-id="'+e.runtime.current_element_mouse_down_gallery_control+'"]'),((a=t.pageX-e.runtime.current_element_mouse_down_gallery_control_position_x)>=e.runtime.mouse_down_diff_touch_action||-1*a>=e.runtime.mouse_down_diff_touch_action)&&(e.runtime.tmp.is_grab=!0),n=parseFloatLadiPage(i.getElementsByClassName("ladi-gallery-control-box")[0].getAttribute("data-left"))||0,(n+=a)<(r=(parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control")[0]).width)||0)-(parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control-box")[0]).width)||0))&&(n=r),n>0&&(n=0),i.getElementsByClassName("ladi-gallery-control-box")[0].style.setProperty("left",n+"px")),e.runtime.isDesktop||e.runtime.isBrowserDesktop||document.body.classList.add("grab"),!e.runtime.tmp.is_grab||(t.preventDefault(),!1)},LadiPageScriptV2.prototype.runEventMouseUp=function(t){t.stopPropagation();var e=this;e instanceof LadiPageScriptV2||(e=LadiPageScript),t=e.getEventCursorData(t);var i=null,a=null;if(delete e.runtime.tmp.is_grab,document.body.classList.remove("grab"),isEmptyLadiPage(e.runtime.current_element_mouse_down_carousel)||(i=document.getElementById(e.runtime.current_element_mouse_down_carousel),a=e.runtime.eventData[i.id],isObjectLadiPage(a)&&isEmptyLadiPage(a["option.meta_data.version"])&&i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("left",i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-left")),isObjectLadiPage(a)&&a["option.meta_data.version"]==e.const.META_VERSION.two&&(a[e.runtime.device+".option.carousel_setting.display_type"]==e.const.CAROUSEL_DISPLAY_TYPE.horizontal&&i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("left",i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-left")),a[e.runtime.device+".option.carousel_setting.display_type"]==e.const.CAROUSEL_DISPLAY_TYPE.vertical&&i.getElementsByClassName("ladi-carousel-content")[0].style.setProperty("top",i.getElementsByClassName("ladi-carousel-content")[0].getAttribute("data-top")))),isEmptyLadiPage(e.runtime.current_element_mouse_down_gallery_view)||(i=document.querySelector('[data-runtime-id="'+e.runtime.current_element_mouse_down_gallery_view+'"]')).querySelectorAll(".ladi-gallery-view-item.selected").length>0&&i.querySelectorAll(".ladi-gallery-view-item.selected")[0].style.removeProperty("left"),!isEmptyLadiPage(e.runtime.current_element_mouse_down_gallery_control))if((i=document.querySelector('[data-runtime-id="'+e.runtime.current_element_mouse_down_gallery_control+'"]')).getElementsByClassName("ladi-gallery-control-box")[0].removeAttribute("data-left"),i.getElementsByClassName("ladi-gallery-control-box")[0].style.removeProperty("transition-duration"),i.getElementsByClassName("ladi-gallery-control-arrow-left")[0].classList.remove("opacity-0"),i.getElementsByClassName("ladi-gallery-control-arrow-right")[0].classList.remove("opacity-0"),i.getElementsByClassName("ladi-gallery")[0].classList.contains("ladi-gallery-top")||i.getElementsByClassName("ladi-gallery")[0].classList.contains("ladi-gallery-bottom")){var n=parseFloatLadiPage(i.getElementsByClassName("ladi-gallery-control-box")[0].style.getPropertyValue("left"))||0,o=parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control-box")[0]).width)||0;o=(o=-(o-=parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control")[0]).width)||0))>0?0:o,n>0&&(n=0),n>=0&&i.getElementsByClassName("ladi-gallery-control-arrow-left")[0].classList.add("opacity-0"),n<=o&&i.getElementsByClassName("ladi-gallery-control-arrow-right")[0].classList.add("opacity-0")}else{var r=parseFloatLadiPage(i.getElementsByClassName("ladi-gallery-control-box")[0].style.getPropertyValue("top"))||0,d=parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control-box")[0]).height)||0;d=(d=-(d-=parseFloatLadiPage(getComputedStyle(i.getElementsByClassName("ladi-gallery-control")[0]).height)||0))>0?0:d,r>0&&(r=0),r>=0&&i.getElementsByClassName("ladi-gallery-control-arrow-left")[0].classList.add("opacity-0"),r<=d&&i.getElementsByClassName("ladi-gallery-control-arrow-right")[0].classList.add("opacity-0")}e.runtime.current_element_mouse_down_image_compare=null,e.runtime.current_element_mouse_down_image_compare_position_x=0,delete e.runtime.timenext_carousel[e.runtime.current_element_mouse_down_carousel],e.runtime.current_element_mouse_down_carousel=null,e.runtime.current_element_mouse_down_carousel_position_x=0,e.runtime.current_element_mouse_down_carousel_position_y=0,e.runtime.current_element_mouse_down_gallery_view=null,e.runtime.current_element_mouse_down_gallery_view_position_x=0,e.runtime.current_element_mouse_down_gallery_view_position_y=0;var l=0;e.runtime.current_element_mouse_down_gallery_control_time+e.runtime.current_element_mouse_down_gallery_control_time_click0;)i[0].classList.remove("ladi-lazyload");e.runtime.tmp.isRunScrollEvent=!0}if(!isEmptyLadiPage(e.runtime.eventData)&&!e.runtime.tmp.is_run_show_popup){for(var a=null,n=document.querySelectorAll('[data-popup-backdrop="true"]'),o=0;o=n&&window.scrollY<=n+d.offsetHeight||window.scrollY+e.getHeightDevice()>=n&&window.scrollY+e.getHeightDevice()<=n+d.offsetHeight||n>=window.scrollY&&window.scrollY+e.getHeightDevice()>=n)&&(p=!0)):(n=e.getElementBoundingClientRect(d).y+window.scrollY,(window.scrollY>=n&&window.scrollY<=n+d.offsetHeight||window.scrollY+e.getHeightDevice(!0)>=n&&window.scrollY+e.getHeightDevice(!0)<=n+d.offsetHeight||n>=window.scrollY&&window.scrollY+e.getHeightDevice(!0)>=n)&&(p=!0)),p&&(o=e.runtime.list_scroll_func[u],delete e.runtime.list_scroll_func[u],o())}}var m=i[e.runtime.device+".style.animation-name"];if(!isEmptyLadiPage(m)&&(d=document.getElementById(t),!isEmptyLadiPage(d)&&!d.classList.contains("ladi-animation"))){var g=e.findAncestor(d,"ladi-popup"),_=parseFloatLadiPage(i[e.runtime.device+".style.animation-delay"])||0;n=e.getElementBoundingClientRect(d).y+window.scrollY;var y=window.scrollY>=n&&window.scrollY<=n+d.offsetHeight||window.scrollY+e.getHeightDevice(!0)>=n&&window.scrollY+e.getHeightDevice(!0)<=n+d.offsetHeight||n>=window.scrollY&&window.scrollY+e.getHeightDevice(!0)>=n;if(e.runtime.tmp.isFirstScroll&&_>0&&d.classList.add("ladi-animation-hidden"),y)if(isEmptyLadiPage(g)){var h=e.findAncestor(d,"ladi-carousel");isEmptyLadiPage(h)?(d.classList.add("ladi-animation"),e.runTimeout(function(){d.classList.remove("ladi-animation-hidden")},1e3*_)):(d.classList.add("ladi-animation-hidden"),h=e.findAncestor(h,"ladi-element"),e.runAnimationDoc(h,null,{is_multiple:!0,element_type:"carousel"}))}else d.classList.add("ladi-animation-hidden")}if(isEmptyLadiPage(a)||-1!=r.indexOf(t)){var f=null,v=null,E=null;if(i[e.runtime.device+".option.sticky"]&&(f=i[e.runtime.device+".option.sticky_position"],v=parseFloatLadiPage(i[e.runtime.device+".option.sticky_position_top"]),E=parseFloatLadiPage(i[e.runtime.device+".option.sticky_position_bottom"])),!e.runtime.has_popupx&&!isEmptyLadiPage(f)){var P=document.getElementById(t);if(!isEmptyLadiPage(P)&&P.clientWidth>0&&P.clientHeight>0&&-1!=["default","top","bottom"].indexOf(f)){var L=e.getElementBoundingClientRect(P),b=P.getAttribute("data-top"),A=P.getAttribute("data-left");isEmptyLadiPage(b)?(P.setAttribute("data-top",L.y+window.scrollY),b=L.y):b=parseFloatLadiPage(b),isEmptyLadiPage(A)?(P.setAttribute("data-left",L.x+window.scrollX),A=L.x):A=parseFloatLadiPage(A);var T=null,w=null,S=e.getHeightDevice(),O=document.getElementsByClassName("ladi-wraper")[0],k=0,C=0,I=0,N=0;if("default"==f&&(v>=b-window.scrollY?(T=v+"px",w=A+"px",v<=0&&(k=P.clientHeight),I=P.clientHeight):S-E-P.clientHeight<=b-window.scrollY&&(T="calc(100% - "+(E+P.clientHeight)+"px)",w=A+"px",E<=0&&(C=P.clientHeight),N=P.clientHeight)),"top"==f&&(v>=b-window.scrollY||S-0b+P.clientHeight-window.scrollY)&&(T="calc(100% - "+(E+P.clientHeight)+"px)",w=A+"px",E<=0&&(C=P.clientHeight),N=P.clientHeight),isEmptyLadiPage(T)||isEmptyLadiPage(w))P.style.removeProperty("top"),P.style.removeProperty("left"),P.style.removeProperty("width"),P.style.removeProperty("position"),P.style.removeProperty("z-index"),O.getAttribute("data-padding-top-id")==t&&(O.removeAttribute("data-padding-top-id"),O.style.removeProperty("padding-top")),O.getAttribute("data-padding-bottom-id")==t&&(O.removeAttribute("data-padding-bottom-id"),O.style.removeProperty("padding-bottom"));else if("section"==i.type&&(e.runtime.is_mobile_only?P.style.setProperty("width",O.clientWidth+"px"):e.runtime.isDesktop&&P.style.setProperty("width","100%"),k>0&&(O.setAttribute("data-padding-top-id",t),O.style.setProperty("padding-top",k+"px")),C>0&&(O.setAttribute("data-padding-bottom-id",t),O.style.setProperty("padding-bottom",C+"px")),I>0&&O.setAttribute("data-scroll-padding-top",I),N>0&&O.setAttribute("data-scroll-padding-bottom",N)),P.style.setProperty("top",T),P.style.setProperty("left",w),P.style.setProperty("position","fixed"),P.style.setProperty("z-index","90000050"),!P.hasAttribute("data-sticky")){P.setAttribute("data-sticky",!0);var x=parseFloatLadiPage(i[e.runtime.device+".style.animation-delay"])||0;P.classList.contains("ladi-animation")&&(x=0),e.runTimeout(function(){P.classList.contains("ladi-animation-hidden")&&(P.classList.remove("ladi-animation-hidden"),P.classList.add("ladi-animation"));for(var t=P.getElementsByClassName("ladi-animation-hidden");t.length>0;)t[0].classList.add("ladi-animation"),t[0].classList.remove("ladi-animation-hidden");P.classList.remove("ladi-lazyload");for(var e=P.getElementsByClassName("ladi-lazyload");e.length>0;)e[0].classList.remove("ladi-lazyload")},1e3*x)}}}}if("popup"==i.type){if(!isEmptyLadiPage(e.runtime.scroll_show_popup[t]))return;isEmptyLadiPage(i["option.popup_welcome_page_scroll_to"])||(d=document.getElementById(i["option.popup_welcome_page_scroll_to"]),!isEmptyLadiPage(d)&&d.offsetHeight>0&&(n=d.offsetTop,(window.scrollY>=n&&window.scrollY<=n+d.offsetHeight||window.scrollY+e.getHeightDevice()>=n&&window.scrollY+e.getHeightDevice()<=n+d.offsetHeight||n>=window.scrollY&&window.scrollY+e.getHeightDevice()>=n)&&(e.runtime.scroll_show_popup[t]=!0,window.ladi(t).show())))}if("section"==i.type){if(!isEmptyLadiPage(e.runtime.scroll_to_section[t]))return;d=document.getElementById(t),!isEmptyLadiPage(d)&&d.offsetHeight>0&&(n=d.offsetTop,(window.scrollY>=n&&window.scrollY<=n+d.offsetHeight||window.scrollY+e.getHeightDevice()>=n&&window.scrollY+e.getHeightDevice()<=n+d.offsetHeight||n>=window.scrollY&&window.scrollY+e.getHeightDevice()>=n)&&(e.runtime.scroll_to_section[t]=!0,e.runEventTracking(t,{is_form:!1})))}}),e.runtime.isClient&&document.body.clientHeight>0){var s=Math.round((window.scrollY+e.getHeightDevice())/document.body.clientHeight*100);s=s>100?100:s;var c=function(t){var i=function(t){if(t||isObjectLadiPage(window.ladi_conversion_api)&&isObjectLadiPage(window.ladi_conversion_api.tiktok)&&isArrayLadiPage(window.ladi_conversion_api.tiktok.pixels))return{event_id:"ladi."+Date.now()+"."+(Math.floor(9e10*Math.random())+1e10)};return{}}(e.runtime.is_popupx),a=null;e.runtime.is_popupx?e.runLadiPageCommand(function(n){if("ViewContent"==n.name&&t>=n.scrollPercent)return a=[{name:n.name,custom_data:{},data:i}],e.runtime.tmp.runActionPopupX({conversion_name:n.name,ttq_data:{},ttq_event_data:i,action:{type:"run_tracking_ttq"}}),e.runtime.tmp.runActionPopupX({type:"tiktok",key:"events",keyData:a,action:{type:"run_conversion_api"}}),!0}):LadiPageQueueCommand.push(function(){return!isNullLadiPage(window.ttq)},function(){e.runLadiPageCommand(function(n){if("ViewContent"==n.name&&t>=n.scrollPercent)return a=[{name:n.name,custom_data:{},data:i}],window.ttq.track(n.name,{},i),e.runConversionApi("tiktok","events",a),!0})})},u=function(t){LadiPageQueueCommand.push(function(){return isFunctionLadiPage(window.fbq)},function(){window.fbq("trackCustom","ScrollDepth_"+t+"_percent")})},p=function(t){LadiPageQueueCommand.push(function(){return isFunctionLadiPage(window.gtag)},function(){window.gtag("event","ScrollDepth_"+t+"_percent",{event_category:"LadiPageScrollDepth",event_label:window.location.host+window.location.pathname,non_interaction:!0})})};if(!e.runtime.is_popupx)for(var m=1;me.const.PERCENT_TRACKING_SCROLL[m-1]&&s<=g&&-1==e.runtime.scroll_depth.indexOf(g)&&(e.runtime.scroll_depth.push(g),u(g),p(g),c(s))}}if(e.runtime.tmp.isFirstScroll=!1,!isEmptyLadiPage(t)){var _=0,y=Object.values(e.runtime.list_scrolling_exec);if(isEmptyLadiPage(e.runtime.tmp.timeout_scrolling_id))for(_=0;_ .ladi-element"),d=!1,l=!1;e||(LadiPagePlugin.getPlugin("popup").removeStyleShowPopupBuilder(),LadiPagePlugin.getPlugin("popup").removeStyleShowPopupBuilderScroll());var s=function(){if(!o.runtime.tmp.is_resize_all&&!o.runtime.tmp.is_wait_popup){var t=document.getElementById("style_popup");isEmptyLadiPage(t)||t.parentElement.removeChild(t)}},c=[],u=0;if(isEmptyLadiPage(t))for(u=0;u .ladi-element"),o=0;o0;){r.runtime.list_show_popup_func[e].shift()()}var p=d.hasAttribute("data-scroll"),m=d.hasAttribute("data-fixed-close"),g=!1,_=d.getElementsByClassName("ladi-popup")[0],y=1e3*(parseFloatLadiPage(getComputedStyle(_).animationDuration)||0),h=1e3*(parseFloatLadiPage(getComputedStyle(_).animationDelay)||0),f=parseFloatLadiPage(d.getAttribute("data-timeout-id"))||null;r.removeTimeout(f),f=parseFloatLadiPage(d.getAttribute("data-timeout-id-2"))||null,r.removeTimeout(f),!n||"true"==d.getAttribute("data-dropbox")||r.runtime.tmp.is_resize_all||r.runtime.tmp.is_wait_popup||isEmptyLadiPage(d.style.getPropertyValue("max-height"))&&(r.runtime.has_popupx||d.style.setProperty("visibility","hidden"));if(d.classList.add("ladi-animation-hidden"),"block"!=getComputedStyle(d).display&&d.style.setProperty("display","block","important"),f=r.runTimeout(function(){d.classList.remove("ladi-animation-hidden"),d.removeAttribute("data-timeout-id"),function(){for(var t=_.getElementsByClassName("ladi-animation");t.length>0;)t[0].classList.add("ladi-animation-hidden"),t[0].classList.remove("ladi-animation");isObjectLadiPage(r.runtime.tmp.list_timeout_popup_id)||(r.runtime.tmp.list_timeout_popup_id={}),isArrayLadiPage(r.runtime.tmp.list_timeout_popup_id[e])||(r.runtime.tmp.list_timeout_popup_id[e]=[]),r.runtime.tmp.list_timeout_popup_id[e].forEach(function(t){r.removeTimeout(t)}),r.runtime.tmp.list_timeout_popup_id[e]=[]}(),f=r.runTimeout(function(){!function(){for(var t=function(t){var i=r.findAncestor(t,"ladi-element"),a=0;if(!isEmptyLadiPage(i)){var n=r.runtime.eventData[i.id];isEmptyLadiPage(n)||(a=parseFloatLadiPage(n[r.runtime.device+".style.animation-delay"])||0)}t.classList.add("ladi-animation");var o=r.runTimeout(function(){t.classList.remove("ladi-animation-hidden")},1e3*a);r.runtime.tmp.list_timeout_popup_id[e].push(o)},i=function(){for(var t=[],e=_.getElementsByClassName("ladi-animation-hidden"),i=0;i.8*r.getHeightDevice()&&(n?r.runtime.has_popupx?g=!0:(d.setAttribute("data-scroll",!0),d.style.setProperty("overflow-y","auto","important"),d.style.setProperty("overflow-x","hidden","important"),p=!0):m=!0),r.runtime.has_popupx&&(g?(d.setAttribute("data-fixed-close",!0),document.body.style.setProperty("height",d.clientHeight+"px")):document.body.style.removeProperty("height")),p&&n)){var v=d.scrollTop;d.getElementsByClassName("ladi-popup")[0].style.removeProperty("height"),d.style.removeProperty("max-height"),d.getElementsByClassName("ladi-popup")[0].style.setProperty("height",d.clientHeight+"px","important"),d.style.setProperty("max-height","80vh"),d.scrollTop=v}!n&&m&&LadiPagePlugin.getPlugin("popup").styleShowPopupBuilderScroll(e),r.runtime.has_popupx&&(c+=n?"#"+r.runtime.backdrop_popup_id+" { display: none !important;}":"#"+r.runtime.backdrop_popup_id+" { display: block !important;}",d.style.removeProperty("max-height"),d.style.removeProperty("overflow-y"),d.style.removeProperty("overflow-x")),isEmptyLadiPage(c)||r.runtime.tmp.is_resize_all||r.runtime.tmp.is_wait_popup||r.createStyleElement("style_popup",c);var E=null;if(n&&!isEmptyLadiPage(d)&&"true"!=d.getAttribute("data-dropbox")){var P=d.getElementsByClassName("popup-close")[0];isEmptyLadiPage(P)&&((P=document.createElement("div")).className="popup-close",d.appendChild(P),P.addEventListener("click",function(t){t.stopPropagation(),r.runtime.tmp["popup_closing_"+e]=!0,r.runRemovePopup(e,n),r.runTimeout(function(){delete r.runtime.tmp["popup_closing_"+e]},500)})),f=parseFloatLadiPage(P.getAttribute("data-timeout-id"))||null,r.removeTimeout(f),"true"==d.getAttribute("data-scroll")&&(P.style.removeProperty("right"),P.style.removeProperty("top"),P.style.removeProperty("position")),r.runtime.has_popupx&&r.runtime.tmp.popupx_is_inline&&P.classList.add("ladi-hidden");var L=function(){if(P=d.getElementsByClassName("popup-close")[0],!isEmptyLadiPage(P))if("true"==d.getAttribute("data-scroll")){var t=r.getElementBoundingClientRect(d),e=t.y,i=window.innerWidth-t.x-t.width;(p||g)&&(i+=r.runtime.widthScrollBar),P.style.setProperty("right",i+"px"),P.style.setProperty("top",e+"px"),P.style.setProperty("position","fixed")}else P.style.removeProperty("right"),P.style.removeProperty("top"),P.style.removeProperty("position")};L(),E=function(){f=r.runTimeout(function(){L(),P.removeAttribute("data-timeout-id")},y+h+100),P.setAttribute("data-timeout-id",f)},(p||g)&&(d.hasAttribute("data-resize-scroll")||(d.setAttribute("data-resize-scroll",!0),window.addEventListener("resize",L)))}n&&!u&&(r.runEventTracking(e,{is_form:!1,is_open_popup:!0,is_custom:!0,event:o.event}),r.runActionPopupShow(e));var b=function(){var t=s;f=r.runTimeout(function(){delete r.runtime.tmp.is_run_show_popup,r.runEventScroll(),isFunctionLadiPage(E)&&E(),d.removeAttribute("data-timeout-id-2")},t),isEmptyLadiPage(f)||d.setAttribute("data-timeout-id-2",f),d.style.removeProperty("visibility")};if(t)b();else{f=r.runTimeout(function(){"none"==getComputedStyle(d).display?(s-=100,b()):l(!0),d.removeAttribute("data-timeout-id-2")},100),d.setAttribute("data-timeout-id-2",f)}d.removeAttribute("data-timeout-id-3")},s=0;i==r.const.POSITION_TYPE.default&&(s=100);var c=r.runTimeout(function(){l(t)},s);isEmptyLadiPage(d)||d.setAttribute("data-timeout-id-3",c)}}},LadiPageScriptV2.prototype.convertPhoneNumberFormData=function(t){for(var e=null,i=[{startStr:"+84",endStr:"(9|8|7|5|3)[0-9]{8}",listRegex:[{str_start:"0",str_input:"0"},{str_start:"\\+84",str_input:"+84"}]}],a=0;a0;){var t=window.ladi_global_tracking.thankyou_page.shift();this.runEventTracking(null,t)}},LadiPageScriptV2.prototype.runLadiPageCommand=function(t){if(isArrayLadiPage(LadiPageCommand))for(var e=0;e0&&(n=t.facebook_pixel.split(",").removeSpace()).length>0){i+="